FED实验室 - 专注WEB端开发和用户体验

Karma安装后报karma: command not found

AUTOMATION 煦涵 4301℃ 0评论

一、Karma安装

root@ubuntu:/var/www/yeomanProj# npm install -g karma
 ...
 ...
 > ws@0.4.31 install /usr/local/lib/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
 &gt; (node-gyp rebuild 2&gt; builderror.log) || (exit 0)</pre>
make: Entering directory `/usr/local/lib/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/obj.target/bufferutil.node
SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Finished
COPY Release/bufferutil.node
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/obj.target/validation.node
SOLINK_MODULE(target) Release/obj.target/validation.node: Finished
COPY Release/validation.node
make: Leaving directory `/usr/local/lib/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build'
karma@0.12.17 /usr/local/lib/node_modules/karma
├── di@0.0.1
├── graceful-fs@2.0.3
├── rimraf@2.2.8
├── colors@0.6.2
├── mime@1.2.11
├── q@0.9.7
├── minimatch@0.2.14 (sigmund@1.0.0, lru-cache@2.5.0)
├── optimist@0.6.1 (wordwrap@0.0.2, minimist@0.0.10)
├── source-map@0.1.37 (amdefine@0.1.0)
├── glob@3.2.11 (inherits@2.0.1, minimatch@0.3.0)
├── chokidar@0.8.2 (recursive-readdir@0.0.2)
├── lodash@2.4.1
├── log4js@0.6.15 (semver@1.1.4, async@0.1.15, readable-stream@1.0.27-1)
├── useragent@2.0.9 (lru-cache@2.2.4)
├── http-proxy@0.10.4 (pkginfo@0.3.0, utile@0.2.1)
├── connect@2.12.0 (uid2@0.0.3, methods@0.1.0, cookie-signature@1.0.1, pause@0.0.1, debug@0.8.1, fresh@0.2.0, qs@0.6.6, bytes@0.2.1, buffer-crc32@0.2.1, raw-body@1.1.2, batch@0.5.0, cookie@0.1.0, negotiator@0.3.0, send@0.1.4, multiparty@2.2.0)
└── socket.io@0.9.17 (base64id@0.1.0, policyfile@0.0.4, redis@0.7.3, socket.io-client@0.9.16)

二、测试是否安装成功

root@ubuntu:/var/www/yeomanProj# karma start
No command 'karma' found, did you mean:
Command 'karm' from package 'ktimetracker' (main)
karma: command not found

1.上面报karma命令不存在:查找原因,新建软连接可以解决此问题

root@ubuntu:/usr/local/bin# ln -s /usr/local/lib/node_modules/karma/bin/karma karma

2.再次运行karma start命令,测试成功

root@ubuntu:/var/www/yeomanProj# karma start
INFO [karma]: Karma v0.12.17 server started at http://localhost:9876/

 

下面是「FED实验室」的微信公众号二维码,欢迎扫描关注:

FED实验室

行文不易,如有帮助,欢迎打赏!

赞赏支持or喜欢 (0)or分享 (0)
捐赠共勉
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址