【发布时间】:2015-02-05 18:32:36
【问题描述】:
我正在尝试在命令行界面上为流星安装一个包,但我不断收到错误消息。我尝试重新安装 node 和 npm,但错误仍然存在。我不知道如何继续。
这是我在 CLI 中收到的消息:
USERs-MacBook-Pro:meteor USER$ sudo npm -g install meteor-em
> fibers@1.0.1 install /usr/local/lib/node_modules/meteor-em/node_modules/fibers
> node ./build.js
gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/USER/.node-gyp/0.10.34"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/meteor-em/node_modules/fibers/.node-gyp"
/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py:873: Warning: 'as' will become a reserved keyword in Python 2.6
Traceback (most recent call last):
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 11, in <module>
import gyp
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 8, in <module>
import gyp.input
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 873
except ImportError as e:
^
SyntaxError: invalid syntax
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Darwin 13.4.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/meteor-em/node_modules/fibers
gyp ERR! node -v v0.10.34
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
Build failed
npm ERR! Darwin 13.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "-g" "install" "meteor-em"
npm ERR! node v0.10.34
npm ERR! npm v2.1.14
npm ERR! code ELIFECYCLE
npm ERR! fibers@1.0.1 install: `node ./build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fibers@1.0.1 install script 'node ./build.js'.
npm ERR! This is most likely a problem with the fibers package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls fibers
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/USER/Code/Meteor/npm-debug.log
USERs-MacBook-Pro:meteor USER$
更新:
-有趣的细节:从来没有提示我输入密码
-找到discussion thread on the topic。现在通读:
-刚刚安装node-gyp
-也安装了node-fibers
【问题讨论】:
-
第一个问题你安装其他 npm 包有问题吗?其次,您应该 chown npm 位置,以免使用 sudo
-
1:从未尝试安装任何其他 npm 包。 2:陈?我想我会谷歌它
-
Chown 表示在您的情况下更改所有权,您需要以不执行 sudo 的方式收回安装 npm 的位置的所有权
标签: javascript node.js command-line meteor npm