【问题标题】:nodejs_'npm install oracle' occur errorsnodejs_'npm install oracle'出现错误
【发布时间】:2014-12-17 14:40:29
【问题描述】:

在 nodejs 上安装 oracle 时出现错误。 我正在按照本网站 (https://github.com/joeferner/node-oracle) 中编写的步骤进行操作,并且 最后,“npm install oracle”不起作用。

我下载了python2.7.8、visual studio express 2012 for desktop和instantclient(basic和sdk) 在名为“Project”的同一目录中,并在我的笔记本电脑中设置环境变量。

这是发生的错误。

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”的原因...

【问题讨论】:

    标签: node.js oracle python-2.7 installation node-oracle


    【解决方案1】:

    尝试使用本教程设置 python 系统变量: http://www.katsbits.com/tutorials/blender/python-path-variable.php

    【讨论】:

    • 好吧,我现在看不懂。我已经设置了系统变量,路径也正确。 :(
    【解决方案2】:

    看起来你是在 Windows 上运行的。

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

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

    尝试在虚拟机上安装以在社区驱动的支持环境操作系统上运行节点应用程序。

    如果您决定在 Ubuntu 上运行 Instantclient,我已使用本指南来安装 Instantclient 和编译 oci8 https://help.ubuntu.com/community/PHPOracle

    我为此做了一个要点。 https://gist.github.com/ChaosPower/e533c0542ad0def26cfb

    如果它有效,请告诉我,如果无效,让我尝试复制你的。

    【讨论】:

      【解决方案3】:

      不是直接回答您的问题,但如果您熟悉 C#,另一种选择是在进程内调用 .NET 并利用 .NET 成熟的数据库生态系统。参考我的回答here

      【讨论】:

      • 试试这个。
      【解决方案4】:
      npm install npm@install
      

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

      【讨论】:

        猜你喜欢
        • 2020-02-20
        • 2022-01-21
        • 1970-01-01
        • 1970-01-01
        • 2019-05-16
        • 2021-12-22
        • 2022-01-12
        • 2020-01-19
        • 2015-08-21
        相关资源
        最近更新 更多