安装node.js软件包时出错。鹰嘴豆泥

时间:2018-06-24 03:33:01

标签: node.js npm hummus.js

我无法使用命令安装软件包

npm install -g hummus

日志中的错误是:

1926 verbose stack Error: hummus@1.0.87 install: `node-pre-gyp install --fallback-to-build`
1926 verbose stack Exit status 1
1926 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
1926 verbose stack     at emitTwo (events.js:126:13)
1926 verbose stack     at EventEmitter.emit (events.js:214:7)
1926 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
1926 verbose stack     at emitTwo (events.js:126:13)
1926 verbose stack     at ChildProcess.emit (events.js:214:7)
1926 verbose stack     at maybeClose (internal/child_process.js:925:16)
1926 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
1927 verbose pkgid hummus@1.0.87
1928 verbose cwd C:\Users\name\Downloads\lab\data\docs\hummusjs
1929 verbose Windows_NT 10.0.17134
1930 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "hummus"
1931 verbose node v8.9.4
1932 verbose npm  v5.6.0
1933 error code ELIFECYCLE
1934 error errno 1
1935 error hummus@1.0.87 install: `node-pre-gyp install --fallback-to-build`
1935 error Exit status 1
1936 error Failed at the hummus@1.0.87 install script.
1936 error This is probably not a problem with npm. There is likely additional logging output above.
1937 verbose exit [ 1, true ]

命令行的输出是:

> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Tried to download(404): https://hummus.s3-us-west-2.amazonaws.com/hummus/v1.0.87/node-v57-win32-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for hummus@1.0.87 and node@8.9.4 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
The system cannot find the path specified.
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\name\\AppData\\Roaming\\npm\\node_modules\\hummus\\binding\\hummus.node" "--module_name=hummus" "--module_path=C:\\Users\\name\\AppData\\Roaming\\npm\\node_modules\\hummus\\binding" "--napi_version=1" "--node_abi_napi=napi"
gyp ERR! cwd C:\Users\name\AppData\Roaming\npm\node_modules\hummus
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\name\AppData\Roaming\npm\node_modules\hummus\binding\hummus.node --module_name=hummus --module_path=C:\Users\name\AppData\Roaming\npm\node_modules\hummus\binding --napi_version=1 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\name\AppData\Roaming\npm\node_modules\hummus\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Windows_NT 10.0.17134
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\name\\AppData\\Roaming\\npm\\node_modules\\hummus\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\name\AppData\Roaming\npm\node_modules\hummus
node-pre-gyp ERR! node -v v8.9.4
node-pre-gyp ERR! node-pre-gyp -v v0.10.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\name\AppData\Roaming\npm\node_modules\hummus\binding\hummus.node --module_name=hummus --module_path=C:\Users\name\AppData\Roaming\npm\node_modules\hummus\binding --napi_version=1 --node_abi_napi=napi' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hummus@1.0.87 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hummus@1.0.87 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\name\AppData\Roaming\npm-cache\_logs\2018-06-23T13_48_48_779Z-debug.log

我是node.js的新手,不知道这些消息在说什么。行中打印的路径

node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\name\\AppData\\Roaming\\npm\\node_modules\\hummus\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"

Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\name\AppData\Roaming\npm\node_modules\hummus\binding\hummus.node --module_name=hummus --module_path=C:\Users\name\AppData\Roaming\npm\node_modules\hummus\binding --napi_version=1 --node_abi_napi=napi' (1)

在命令行输出中,我的驱动器上不存在

C:\Users\name\AppData\Roaming\npm\node_modules\ 

不存在。

我尝试将NODE_PATH环境变量设置为具有node_modules文件夹的路径:

C:\Program Files\nodejs\node_modules\npm\node_modules

但是我遇到同样的错误。

1 个答案:

答案 0 :(得分:0)

.travis.yml看,这些版本已发布了二进制文件:

NODE_NVM_VERSION="0.12.18"
NODE_NVM_VERSION="4.9.1"
NODE_NVM_VERSION="5.12.0"
NODE_NVM_VERSION="6.14.1"
NODE_NVM_VERSION="7.10.1"
NODE_NVM_VERSION="8.11.1"
NODE_NVM_VERSION="9.11.1"

您可以更新到Node 8.11.1(您使用的是8.9.4)并重试吗?