我使用node.js来安装业力。当已经安装业力时找不到karma命令
npm install -g karma
那失败,所以我决定用:终端上运行以下命令时,我第一次尝试失败
sudo npm install -g karma
输入我的密码后,它似乎正确安装。 我粘贴安装的输出的一部分,也许这对某人意味着什么,它将与我的问题有关。所有的NPM HTTP消息后,这是我所看到的:
> [email protected] install /usr/local/share/npm/lib/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/bufferutil.node
SOLINK_MODULE(target) Release/bufferutil.node: Finished
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/validation.node
SOLINK_MODULE(target) Release/validation.node: Finished
/usr/local/share/npm/bin/karma -> /usr/local/share/npm/lib/node_modules/karma/bin/karma
[email protected] /usr/local/share/npm/lib/node_modules/karma
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected])
然后,当我尝试运行下面的命令来创建此命令噶配置文件:
karma init karma.config.js
这是消息得到返回:
-bash: karma: command not found
我已经尝试了与sudo相同的命令在它之前,但我得到了同样的结果。
有没有人对发生了什么有什么想法? 任何帮助表示赞赏。
*更新! 我决定检查一个名为:builderror.log 的文件,位于:/usr/local/share/npm/lib/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
这是它表明:
gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/eperez/.node-gyp/0.10.5"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/share/npm/lib/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/.node-gyp"
gyp http GET http://nodejs.org/dist/v0.10.5/node-v0.10.5.tar.gz
gyp http 200 http://nodejs.org/dist/v0.10.5/node-v0.10.5.tar.gz
这显然不是在你的路径,用'这karma'确认。我已经经历了npm安装的东西到一个不在路径的默认位置,我认为在Arch上。我不记得它去了哪里,但对不起:(PS你可以做'cd /; find | grep karma'来得到文件名或路径上的所有文件系统与业力 – Plato
我跑了命令,这就是我得到的。确定它是什么意思:'用法:find [-H | -L | -P] [-EXdsx] [-f路径]路径... [表达式] find [-H | -L | -P] [ - EXdsx] -f path [path ...] [expression]' – iChido
好的,对不起,你的'find'程序的行为与我的不同。无论如何,你需要找到npm安装的东西,并确保文件夹被添加到你的路径中终端会话。在我的Linux Mint上安装FWIW,'npm -g'把东西放在'/ usr/local/bin'里。 – Plato