【发布时间】:2019-03-18 02:21:16
【问题描述】:
我有一个 Bamboo 版本,其中我需要做的一件事是执行 npm install 命令。这一切都很好,除非它遇到一个依赖项,该依赖项产生另一个节点实例以在子子进程中运行npm install。发生这种情况时,我收到以下错误:
12-Oct-2015 12:54:12
12-Oct-2015 12:54:12
12-Oct-2015 12:54:12 D:\bamboo-home\xml-data\build-dir\EC-ECB-BUIL\server\node_modules\oracledb>if not defined npm_config_node_gyp (node "c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
12-Oct-2015 12:54:12 'node' is not recognized as an internal or external command,
12-Oct-2015 12:54:12 operable program or batch file.
12-Oct-2015 12:54:22 npm ERR! Windows_NT 5.2.3790
12-Oct-2015 12:54:22 npm ERR! argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
12-Oct-2015 12:54:22 npm ERR! node v4.1.2
12-Oct-2015 12:54:22 npm ERR! npm v2.14.4
12-Oct-2015 12:54:22 npm ERR! code ELIFECYCLE
12-Oct-2015 12:54:22
12-Oct-2015 12:54:22 npm ERR! oracledb@0.6.0 install: `node-gyp rebuild`
12-Oct-2015 12:54:22 npm ERR! Exit status 1
12-Oct-2015 12:54:22 npm ERR!
12-Oct-2015 12:54:22 npm ERR! Failed at the oracledb@0.6.0 install script 'node-gyp rebuild'.
这是说 node 不是一个可识别的命令,但我可以确认它肯定在系统路径中,如果我通过命令提示符手动执行命令,依赖项安装正常(更不用说,所有其他依赖项都起来了到这个安装好了)。
有谁知道如何解决这个问题?我尝试在 Windows 中设置系统路径,并尝试通过添加以下环境变量在 Bamboo 任务本身中设置我自己的环境变量:PATH="C:\Program Files\nodejs" - 我不确定还能尝试什么。
【问题讨论】:
-
这有点明显,但也许您应该尝试
node并显示其完整路径。 -
嘿@dave - 我不确定你的意思 - 上面的输出来自 Bamboo 执行的节点任务。能详细点吗?
-
在我看来,竹子试图运行
node并失败,因此'node' is not recognized as an internal or external command ...。因此,请尝试在您的外部程序中使用C:\Program Files\nodejs\node.exe(或其他)。 -
正如我在问题中提到的 - 手动运行命令时它可以正常工作,并且它还可以正常安装所有其他依赖项。只有当有一个依赖项有其他依赖项时才会失败。
-
我看到了你的笔记,我正在钓鱼。关键问题似乎是您日志中的错误消息
'node' is not recognized as an internal or external command operable program or batch file.。在我看来,从竹子内运行时,这就像路径问题,但我可能是错的。
标签: node.js windows npm bamboo