nodejs连接达梦DM数据库的问题
发表于 : 2022-01-12 9:15
嗯。
在WIN10的本子上,费了好大的劲,又是安装python又是安装c++的编译环境,总算是连上数据库了。
在UBUNTU上,还没成功。
具体问题:
我使用的Ubuntu的版本:20.04.3TLS,已升级到最新了。
安装的node :v16.13.1,自己下载解压安装的,并在/usr/local/bin下建了软链
node中带的npm的版本:8.1.2
用nodejs做的一个web程序,连接的是另一台机器上的达梦数据库。
工程中用npm安装了dmdb模块,
python的版本:Ubuntu自带python3,版本是3.8.10,我又用apt-get命令安装了python2,版本是2.7.18
用apt-get命令安装了gcc,版本:gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
用npm 全局安装node-gyp好象也没报错
npm i -g node-gyp
changed 90 packages, and audited 91 packages in 10s
4 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
npm中设置python的路径,也正确
npm config set python /usr/bin/python
npm在工程下安装dmdb模块好象也没报错
npm i dmdb
up to date, audited 316 packages in 2s
4 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
工程也能启动,就是连接达梦数据库时报错
node:events:368
throw er; // Unhandled 'error' event
^
Error: ENOENT: no such file or directory, open ''
Emitted 'error' event on Interface instance at:
at ReadStream.onerror (node:readline:265:10)
at ReadStream.emit (node:events:402:35)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: ''
}
另外:这台机器用java连达梦数据库很容易,在idea中的数据库工具连也很容易。所以网络没问题。
在WIN10的本子上,费了好大的劲,又是安装python又是安装c++的编译环境,总算是连上数据库了。
在UBUNTU上,还没成功。
具体问题:
我使用的Ubuntu的版本:20.04.3TLS,已升级到最新了。
安装的node :v16.13.1,自己下载解压安装的,并在/usr/local/bin下建了软链
node中带的npm的版本:8.1.2
用nodejs做的一个web程序,连接的是另一台机器上的达梦数据库。
工程中用npm安装了dmdb模块,
python的版本:Ubuntu自带python3,版本是3.8.10,我又用apt-get命令安装了python2,版本是2.7.18
用apt-get命令安装了gcc,版本:gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
用npm 全局安装node-gyp好象也没报错
npm i -g node-gyp
changed 90 packages, and audited 91 packages in 10s
4 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
npm中设置python的路径,也正确
npm config set python /usr/bin/python
npm在工程下安装dmdb模块好象也没报错
npm i dmdb
up to date, audited 316 packages in 2s
4 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
工程也能启动,就是连接达梦数据库时报错
node:events:368
throw er; // Unhandled 'error' event
^
Error: ENOENT: no such file or directory, open ''
Emitted 'error' event on Interface instance at:
at ReadStream.onerror (node:readline:265:10)
at ReadStream.emit (node:events:402:35)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: ''
}
另外:这台机器用java连达梦数据库很容易,在idea中的数据库工具连也很容易。所以网络没问题。