我使用node.js安装业力。在终端上运行以下命令时,我的第一次尝试失败:
npm install -g karma
失败了,所以我决定使用:
sudo npm install -g karma
输入密码后,它似乎可以正确安装。我正在粘贴安装输出的一部分,也许对某人有意义,并且与我的问题有关。在所有npm http消息之后,这就是我看到的内容:
> ws@0.4.27 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
karma@0.8.6 /usr/local/share/npm/lib/node_modules/karma
├── pause@0.0.1
├── dateformat@1.0.2-1.2.3
├── xmlbuilder@0.4.2
├── colors@0.6.0-1
├── chokidar@0.6.2
├── growly@1.1.1
├── mime@1.2.9
├── q@0.9.6
├── rimraf@2.1.4 (graceful-fs@1.2.3)
├── coffee-script@1.6.3
├── minimatch@0.2.12 (sigmund@1.0.0, lru-cache@2.3.0)
├── optimist@0.3.5 (wordwrap@0.0.2)
├── glob@3.1.21 (inherits@1.0.0, graceful-fs@1.2.3)
├── LiveScript@1.0.1 (prelude-ls@1.0.1)
├── log4js@0.6.6 (dequeue@1.0.3, semver@1.1.4, async@0.1.15, readable-stream@1.0.2)
├── lodash@1.1.1
├── http-proxy@0.10.3 (pkginfo@0.2.3, utile@0.1.7)
├── istanbul@0.1.22 (abbrev@1.0.4, which@1.0.5, fileset@0.1.5, nopt@2.0.0, wordwrap@0.0.2, async@0.1.22, mkdirp@0.3.5, esprima@0.9.9, escodegen@0.0.24, handlebars@1.0.12)
└── socket.io@0.9.16 (base64id@0.1.0, policyfile@0.0.4, redis@0.7.3, socket.io-client@0.9.16)
然后,当我尝试运行以下命令以使用此命令创建业力配置文件时:
karma init karma.config.js
这是返回的消息:
-bash: karma: command not found
我之前曾用sudo尝试过相同的命令,但得到的结果相同。
有谁知道发生了什么吗?任何帮助表示赞赏。
*更新!我决定检查位于/usr/local/share/npm/lib/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws中的名为builderror.log的文件
它显示了以下内容:
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
which karma
。我认为我在Arch上经历过npm将东西安装到默认路径下的情况。我不记得抱歉了,它去了哪里:( ps,您可以执行以下操作:cd /; find|grep karma
在文件名或路径中使用业力获取系统上的所有文件名