我没有得到足够的解决方案来解决我遇到的错误,when do grunt build this is the error。
Initializing
Command-line options: --verbose
Reading "Gruntfile.js" Gruntfile...OK
Registering Gruntfile tasks.
Loading "Gruntfile.js" tasks...ERROR
>> Error: Cannot find module 'load-grunt-tasks'
>> at Function.Module._resolveFilename (module.js:336:15)
>> at Function.Module._load (module.js:278:25)
>> at Module.require (module.js:365:17)
>> at require (module.js:384:17)
>> at Object.module.exports (/home/user/projects/misc/lfc-dev/project/Gruntfile.js:13:3)
>> at loadTask (/home/user/projects/misc/lfc-dev/project/node_modules/grunt/lib/grunt/task.js:325:10)
>> at Task.task.init (/home/user/projects/misc/lfc-dev/project/node_modules/grunt/lib/grunt/task.js:437:5)
>> at Object.grunt.tasks (/home/user/projects/misc/lfc-dev/project/node_modules/grunt/lib/grunt.js:120:8)
>> at Object.module.exports [as cli] (/home/user/projects/misc/lfc-dev/project/node_modules/grunt/lib/grunt/cli.js:38:9)
>> at Object.<anonymous> (/usr/local/lib/node_modules/grunt-cli/bin/grunt:45:20)
Running tasks: build
Warning: Task "build" not found. Use --force to continue.
Aborted due to warnings.我试过了,npm install,npm install grunt,npm install grunt-cli
^^这些也是全局安装的。到目前为止,没有什么对我有帮助。
发布于 2015-07-28 19:50:59
日志上写的是Error: Cannot find module 'load-grunt-tasks'。您缺少load-grunt-tasks。可能它不包含在packages.json中
试一试
npm install --save-dev load-grunt-tasks另外,还要确保npm install之前没有被中断。如果是,请尝试删除node_modules目录,然后再次尝试npm install。
发布于 2015-07-28 19:51:37
我使用的是linux,它请求以sudo的身份运行命令。然后轰隆一声。工作得很好。
https://stackoverflow.com/questions/31669763
复制相似问题