找不到模块' grunt-lib-phantomjs'在' grunt-contrib-qunit'

时间:2014-05-27 19:39:50

标签: gruntjs phantomjs qunit grunt-contrib-qunit

我已安装phantomjs 1.9.7 wgetting zip,然后将其移至ubuntu virtualbox中的PATH。

在nodejs项目上,触发npm install -no-bin-links正常,但grunt test失败并出现以下错误,

root@ubuntu1204:/home/prayagupd/vboxshared/onlywallet# grunt test
Loading "qunit.js" tasks...ERROR
>> Error: Cannot find module 'grunt-lib-phantomjs'
Warning: Task "qunit" not found. Use --force to continue.

Aborted due to warnings.

在检查grunt-contrib-quint时,grunt-lib-phantomjs内没有node_modules

root@ubuntu1204:/home/prayagupd/vboxshared/onlywallet# ls -l node_modules/grunt-contrib-qunit/
total 36
-rwxrwx--- 1 root vboxsf  1076 Oct 14  2012 LICENSE-MIT
-rwxrwx--- 1 root vboxsf 10267 May 27 14:11 package.json
drwxrwx--- 1 root vboxsf  4096 Jun 22  2013 phantomjs
-rwxrwx--- 1 root vboxsf  8660 Jan 17 05:25 README.md
drwxrwx--- 1 root vboxsf  4096 Oct  1  2013 tasks


root@ubuntu1204:/home/prayagupd/vboxshared/onlywallet# ls -l node_modules/grunt-contrib-qunit/phantomjs/
total 4
-rwxrwx--- 1 root vboxsf 1574 Jun 22  2013 bridge.js

但是,在我的本地计算机上,grunt-lib-phantomjs之后我已npm install

$ ls -l node_modules/grunt-contrib-qunit/node_modules/
total 4
drwxrwxr-x 5 prayagupd prayagupd 4096 May 27 22:00 grunt-lib-phantomjs

我的package.json是,

 1 {                                                                                                                                                 
  2   "name": "zazzercode",                                                                             
  3   "version": "0.13.1",                                                                              
  4   "devDependencies": {                                                                              
  5     "grunt": "~0.4.1",                                                                              
  6     "intern": "~1.2.1",                                                                             
  7     "grunt-contrib-jshint": "~0.8.0",                                                               
  8     "grunt-contrib-qunit": "~0.4.0",                                                                
  9     "grunt-contrib-watch": "~0.5.3",                                                                
 10     "grunt-contrib-uglify": "~0.3.2",                                                               
 11     "grunt-contrib-concat": "~0.3.0",                                                               
 12     "grunt-closure-compiler": "0.0.18"                                                              
 13   },                                                                                                
 14   "repository": {                                                                                   
 15     "type": "git",                                                                                  
 16     "url": "https://github.com/iPrayag/onlywallet"                                 
 17   }                                                                                                 
 18 }    

github有很多问题,但没有一个对我有用。

1 个答案:

答案 0 :(得分:0)

<{1}}之前的npm install -g grunt-contrib-qunit似乎有效。