我习惯于成功地完成grunt build
任务,但自从我将我的项目编辑与另一位开发同事的一些内容合并后,它突然失败了,并出现了一个我以前从未见过的错误:
grunt build
Loading "imagemin.js" tasks...ERROR
>> Error: Cannot find module 'process-nextick-args'
Loading "cdnify.js" tasks...ERROR
>> Error: Cannot find module 'abbrev'
Loading "grunt-karma.js" tasks...ERROR
>> Error: Cannot find module 'uglify-js'
Running "clean:dist" (clean) task
>> 0 paths cleaned.
Running "wiredep:app" (wiredep) task
Warning: Cannot find module './lang/clone' Use --force to continue.
Aborted due to warnings.
Execution Time (2015-09-25 09:44:30 UTC)
wiredep:app 31ms
Total 31ms
在Gruntfile.js中,我在
concurrent:dist
和 build
任务中注释掉了imagemin
和cdnify
。
我做错了什么?
这里有一些关于我使用的软件版本信息:
node -v && npm -v && grunt --version
v0.10.35
2.1.1
grunt-cli v0.1.13
grunt v0.4.5
另外,在运行grunt build
之前,我尝试运行了npm install
,但是出现了一些警告,这些警告我以前从未见过,除了其中的三个。
npm WARN package.json rwui@0.0.0 No description
npm WARN package.json rwui@0.0.0 No repository field.
npm WARN package.json rwui@0.0.0 No README data
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\vinyl-fs\node_modules\glob-watcher\node_modules\gaze\node_modules\globule\node_modules\glob requires graceful-fs@'~1.2.0' but will load
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\vinyl-fs\node_modules\graceful-fs,
npm WARN unmet dependency which is version 3.0.8
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-gifsicle\node_modules\gifsicle\node_modules\bin-build\node_modules\download\node_modules\gulp-decompress\node_modules\gulp-util requires object-assign@'^3.0.0' but will load
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-gifsicle\node_modules\gifsicle\node_modules\bin-build\node_modules\download\node_modules\object-assign,
npm WARN unmet dependency which is version 4.0.1
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-gifsicle\node_modules\gifsicle\node_modules\bin-wrapper\node_modules\download\node_modules\gulp-decompress\node_modules\gulp-util requires object-assign@'^3.0.0' but will load
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-gifsicle\node_modules\gifsicle\node_modules\bin-wrapper\node_modules\download\node_modules\object-assign,
npm WARN unmet dependency which is version 4.0.1
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-jpegtran\node_modules\jpegtran-bin\node_modules\bin-build\node_modules\download\node_modules\gulp-decompress\node_modules\gulp-util requires object-assign@'^3.0.0' but will load
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-jpegtran\node_modules\jpegtran-bin\node_modules\bin-build\node_modules\download\node_modules\object-assign,
npm WARN unmet dependency which is version 4.0.1
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-jpegtran\node_modules\jpegtran-bin\node_modules\bin-wrapper\node_modules\download\node_modules\gulp-decompress\node_modules\gulp-util requires object-assign@'^3.0.0' but will load
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-jpegtran\node_modules\jpegtran-bin\node_modules\bin-wrapper\node_modules\download\node_modules\object-assign,
npm WARN unmet dependency which is version 4.0.1
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-optipng\node_modules\optipng-bin\node_modules\bin-build\node_modules\download\node_modules\gulp-decompress\node_modules\gulp-util requires object-assign@'^3.0.0' but will load
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-optipng\node_modules\optipng-bin\node_modules\bin-build\node_modules\download\node_modules\object-assign,
npm WARN unmet dependency which is version 4.0.1
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-optipng\node_modules\optipng-bin\node_modules\bin-wrapper\node_modules\download\node_modules\gulp-decompress\node_modules\gulp-util requires object-assign@'^3.0.0' but will load
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-optipng\node_modules\optipng-bin\node_modules\bin-wrapper\node_modules\download\node_modules\object-assign,
npm WARN unmet dependency which is version 4.0.1
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-google-cdn\node_modules\bower\node_modules\inquirer\node_modules\chalk\node_modules\has-ansi requires ansi-regex@'^0.2.0' but will load
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-google-cdn\node_modules\bower\node_modules\inquirer\node_modules\ansi-regex,
npm WARN unmet dependency which is version 1.1.1
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-google-cdn\node_modules\bower\node_modules\inquirer\node_modules\chalk\node_modules\strip-ansi requires ansi-regex@'^0.2.1' but will load
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-google-cdn\node_modules\bower\node_modules\inquirer\node_modules\ansi-regex,
npm WARN unmet dependency which is version 1.1.1
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-google-cdn\node_modules\google-cdn\node_modules\bower requires chalk@'0.5.0' but will load
npm WARN unmet dependency C:\Users\gesposito\Documents\Developer\Software\Production\reportmed\api_ui\node_modules\grunt-google-cdn\node_modules\chalk,
npm WARN unmet dependency which is version 0.5.1
编辑
我在这里留下了我package.json
的相关部分:
"devDependencies": {
"grunt": "^0.4.5",
"grunt-autoprefixer": "^2.1.0",
"grunt-concurrent": "^1.0.0",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-compass": "^1.0.1",
"grunt-contrib-concat": "^0.5.0",
"grunt-contrib-connect": "^0.9.0",
"grunt-contrib-copy": "^0.7.0",
"grunt-contrib-cssmin": "^0.11.0",
"grunt-contrib-htmlmin": "^0.3.0",
"grunt-contrib-imagemin": "^0.9.2",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-uglify": "^0.7.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-filerev": "^2.1.2",
"grunt-google-cdn": "^0.4.3",
"grunt-karma": "^0.10.1",
"grunt-newer": "^1.1.0",
"grunt-ng-annotate": "^0.8.0",
"grunt-svgmin": "^2.0.0",
"grunt-usemin": "^3.0.0",
"grunt-wiredep": "^2.0.0",
"jasmine-core": "^2.2.0",
"jshint-stylish": "^1.0.0",
"karma": "^0.12.31",
"karma-chrome-launcher": "^0.1.8",
"karma-jasmine": "^0.3.5",
"karma-phantomjs-launcher": "^0.1.4",
"load-grunt-tasks": "^2.0.0",
"time-grunt": "^1.0.0"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "grunt test"
}
请记住,我的同事的
package.json
与我的没有任何区别。