突然咕噜声的构建失败了
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了突然咕噜声的构建失败了相关的知识,希望对你有一定的参考价值。
我习惯于成功完成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中,我在imagemin
和cdnify
任务中评论了concurrent:dist
和build
。
我做错了什么?
这里有一些关于我正在使用的东西版本的信息:
node -v && npm -v && grunt --version
v0.10.35
2.1.1
grunt-cli v0.1.13
grunt v0.4.5
此外,我试图在npm install
之前运行grunt build
,但我有这些警告我以前从未见过,除了三个:
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:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-contrib-imagemin
ode_modulesimagemin
ode_modulesvinyl-fs
ode_modulesglob-watcher
ode_modulesgaze
ode_modulesglobule
ode_modulesglob requires graceful-fs@'~1.2.0' but will load
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-contrib-imagemin
ode_modulesimagemin
ode_modulesvinyl-fs
ode_modulesgraceful-fs,
npm WARN unmet dependency which is version 3.0.8
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-contrib-imagemin
ode_modulesimagemin
ode_modulesimagemin-gifsicle
ode_modulesgifsicle
ode_modulesin-build
ode_modulesdownload
ode_modulesgulp-decompress
ode_modulesgulp-util requires object-assign@'^3.0.0' but will load
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-contrib-imagemin
ode_modulesimagemin
ode_modulesimagemin-gifsicle
ode_modulesgifsicle
ode_modulesin-build
ode_modulesdownload
ode_modulesobject-assign,
npm WARN unmet dependency which is version 4.0.1
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-contrib-imagemin
ode_modulesimagemin
ode_modulesimagemin-gifsicle
ode_modulesgifsicle
ode_modulesin-wrapper
ode_modulesdownload
ode_modulesgulp-decompress
ode_modulesgulp-util requires object-assign@'^3.0.0' but will load
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-contrib-imagemin
ode_modulesimagemin
ode_modulesimagemin-gifsicle
ode_modulesgifsicle
ode_modulesin-wrapper
ode_modulesdownload
ode_modulesobject-assign,
npm WARN unmet dependency which is version 4.0.1
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-contrib-imagemin
ode_modulesimagemin
ode_modulesimagemin-jpegtran
ode_modulesjpegtran-bin
ode_modulesin-build
ode_modulesdownload
ode_modulesgulp-decompress
ode_modulesgulp-util requires object-assign@'^3.0.0' but will load
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-contrib-imagemin
ode_modulesimagemin
ode_modulesimagemin-jpegtran
ode_modulesjpegtran-bin
ode_modulesin-build
ode_modulesdownload
ode_modulesobject-assign,
npm WARN unmet dependency which is version 4.0.1
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-contrib-imagemin
ode_modulesimagemin
ode_modulesimagemin-jpegtran
ode_modulesjpegtran-bin
ode_modulesin-wrapper
ode_modulesdownload
ode_modulesgulp-decompress
ode_modulesgulp-util requires object-assign@'^3.0.0' but will load
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-contrib-imagemin
ode_modulesimagemin
ode_modulesimagemin-jpegtran
ode_modulesjpegtran-bin
ode_modulesin-wrapper
ode_modulesdownload
ode_modulesobject-assign,
npm WARN unmet dependency which is version 4.0.1
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-contrib-imagemin
ode_modulesimagemin
ode_modulesimagemin-optipng
ode_modulesoptipng-bin
ode_modulesin-build
ode_modulesdownload
ode_modulesgulp-decompress
ode_modulesgulp-util requires object-assign@'^3.0.0' but will load
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-contrib-imagemin
ode_modulesimagemin
ode_modulesimagemin-optipng
ode_modulesoptipng-bin
ode_modulesin-build
ode_modulesdownload
ode_modulesobject-assign,
npm WARN unmet dependency which is version 4.0.1
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-contrib-imagemin
ode_modulesimagemin
ode_modulesimagemin-optipng
ode_modulesoptipng-bin
ode_modulesin-wrapper
ode_modulesdownload
ode_modulesgulp-decompress
ode_modulesgulp-util requires object-assign@'^3.0.0' but will load
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-contrib-imagemin
ode_modulesimagemin
ode_modulesimagemin-optipng
ode_modulesoptipng-bin
ode_modulesin-wrapper
ode_modulesdownload
ode_modulesobject-assign,
npm WARN unmet dependency which is version 4.0.1
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-google-cdn
ode_modulesower
ode_modulesinquirer
ode_moduleschalk
ode_moduleshas-ansi requires ansi-regex@'^0.2.0' but will load
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-google-cdn
ode_modulesower
ode_modulesinquirer
ode_modulesansi-regex,
npm WARN unmet dependency which is version 1.1.1
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-google-cdn
ode_modulesower
ode_modulesinquirer
ode_moduleschalk
ode_modulesstrip-ansi requires ansi-regex@'^0.2.1' but will load
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-google-cdn
ode_modulesower
ode_modulesinquirer
ode_modulesansi-regex,
npm WARN unmet dependency which is version 1.1.1
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-google-cdn
ode_modulesgoogle-cdn
ode_modulesower requires chalk@'0.5.0' but will load
npm WARN unmet dependency C:UsersgespositoDocumentsDeveloperSoftwareProduction
eportmedapi_ui
ode_modulesgrunt-google-cdn
ode_moduleschalk,
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
与我的没有任何区别。
答案
看起来你已经过时/混合了npm模块 - 你和同事合并了your node_modules
文件夹吗?
无论如何,我建议删除你的本地node_modules目录,然后重新运行npm install
。
一旦你再次稳定,正确的工作流程应该是:
node_modules
应该不受源头控制- 当你第一次得到这个项目时,运行
npm install
来设置你当地的node_modules
- 然后你只需要在
package.json
改变时触摸它 - 在这种情况下,您运行
npm update
以在本地安装新版本
另一答案
执行install grunt-google-cd@0.3.0
安装版本0.3.0有些组件没有更新版本
以上是关于突然咕噜声的构建失败了的主要内容,如果未能解决你的问题,请参考以下文章