2

Mean-cli 是一个用于初始化 meanio 全栈 javascript 框架的包。但我无法通过 npm 全局安装它。这就是我可以提供给你的,让你明白我的意思。

C:\Windows\System32>npm install -g mean-cli
npm WARN engine mean-cli@0.9.14: wanted: {"node":"0.10.x","npm":"2.1.x"} (current:{"node":"0.10.34","npm":"1.4.28"})

> mean-cli@0.9.14 preinstall C:\Users\Rahul's\AppData\Roaming\npm\node_modules\mean-cli
> node ./scripts/preinstall


npm ERR! mean-cli@0.9.14 preinstall: `node ./scripts/preinstall`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the mean-cli@0.9.14 preinstall script.
npm ERR! This is most likely a problem with the mean-cli package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./scripts/preinstall
npm ERR! You can get their info via:
npm ERR!     npm owner ls mean-cli
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program     
Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "mean-cli"
npm ERR! cwd C:\Windows\System32
npm ERR! node -v v0.10.34
npm ERR! npm -v 1.4.28
npm ERR! syscall spawn
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! not ok code 0

C:\Windows\System32>npm install -g npm
C:\Users\Rahul's\AppData\Roaming\npm\npm -> C:\Users\Rahul's\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
npm@2.1.14 C:\Users\Rahul's\AppData\Roaming\npm\node_modules\npm

C:\Windows\System32>npm -v
2.1.14

C:\Windows\System32>npm install -g mean-cli

> mean-cli@0.9.14 preinstall C:\Program Files\nodejs\node_modules\mean-cli
> node ./scripts/preinstall

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "node" "C:\\Users\\Rahul's\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "mean-cli"
npm ERR! node v0.10.34
npm ERR! npm  v2.1.14
npm ERR! file cmd
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn

npm ERR! mean-cli@0.9.14 preinstall: `node ./scripts/preinstall`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the mean-cli@0.9.14 preinstall script 'node ./scripts/preinstall'.
npm ERR! This is most likely a problem with the mean-cli package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./scripts/preinstall
npm ERR! You can get their info via:
npm ERR!     npm owner ls mean-cli
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Windows\System32\npm-debug.log

C:\Windows\System32>node -v
v0.10.34

C:\Windows\System32>npm -v
2.1.14

我提到了一个堆栈溢出问题,其中讨论了应该更新节点。如你们所见,我的 nodejs 已更新,并且我已更新 npm。但后来我得到 .scripts/preinstall.js 错误。看到他们的 github 票,他们说这个问题已经解决,但我仍然面临它。任何帮助,将不胜感激。

4

1 回答 1

0

我刚刚遇到了同样的问题。

以管理员身份运行控制台为我解决了这个问题。

于 2014-12-20T21:45:38.227 回答