nodejs_'npm install oracle'发生错误

guykilcj  于 2023-06-22  发布在  Node.js
关注(0)|答案(4)|浏览(111)

我在nodejs上安装oracle时遇到错误。我正在按照这个网站(https://github.com/joeferner/node-oracle)上写的步骤操作,最后,'npm install oracle'不起作用。
我在同一个名为“Project”的目录下下载了python2.7.8、visual studio express 2012 for desktop和instantclient(basic和sdk),并在笔记本电脑中设置了环境变量。
以下是发生的错误。

C:\dev\Project>npm install oracle
npm WARN package.json Express-web-app@1.0.0 No description
npm WARN package.json Express-web-app@1.0.0 No repository field
npm WARN package.json fs@0.0.2 fs is also the name of a node core module.
npm WARN package.json fs@0.0.2 fs No description
npm WARN package.json fs@0.0.2 fs No repository field
-
> oracle@0.3.7 install C:\dev\Project\node_modules\oracle
> node-gyp rebuild

C:\dev\Project\node_modules\oracle>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python2.7.8", you can set the PYTHON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:103:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:64:11
enter code here
gyp ERR! stack     at Object.oncomplete (evalmachine.<anonymous>:107:15)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\dev\Project\node_modules\oracle
gyp ERR! node -v v0.10.32
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok

npm ERR! oracle@0.3.7 install: 'node-gyp rebuild'
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the oracle@0.3.7 install script.
npm ERR! This is most likely a problem with the oracle package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls oracle
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "oracle"

我不知道为什么错误说'找不到python可执行文件.....brr' ...

a0zr77ik

a0zr77ik2#

看起来你在Windows上运行。
请看我的评论在https://github.com/joeferner/node-oracle/issues/140#issuecomment-67266788如果它会工作。我的工作就是用这种方法。但是,由于您没有使用Ubuntu Server x64 14.10 LTS。

您可能需要将/etc/environment转换为Windows路径。

尝试在虚拟机上安装,以便在更加社区驱动的支持环境操作系统上运行节点应用程序。
如果您决定在Ubuntu上运行instantclient,我已经使用本指南安装instantclient并编译oci 8 https://help.ubuntu.com/community/PHPOracle
我为此做了一个要点。https://gist.github.com/ChaosPower/e533c0542ad0def26cfb
请告诉我,如果它的工作,如果没有让我尝试复制你的。

jutyujz0

jutyujz03#

npm install npm@install

它显示一个错误,因为它可能是你还没有安装NPM最新版本。

kx7yvsdv

kx7yvsdv4#

这不是对你的问题的直接回答,但如果你对C#很熟悉,另一个选择是调用.NET进程内并利用.NET成熟的数据库生态系统。请参阅我的答案here

相关问题