Gruntjs 咕噜';构建';错误
我在执行Gruntjs 咕噜';构建';错误,gruntjs,bower,yeoman,Gruntjs,Bower,Yeoman,我在执行grunt构建时遇到的错误没有得到足够的解决方案 这就是错误所在 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' >&
grunt构建时遇到的错误没有得到足够的解决方案
这就是错误所在
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.
初始化
命令行选项:--verbose
正在阅读“Gruntfile.js”Gruntfile…好的
正在注册GrunFile任务。
正在加载“Gruntfile.js”任务…错误
>>错误:找不到模块“加载grunt任务”
>>在Function.Module.\u解析文件名(Module.js:336:15)
>>在Function.Module.\u加载(Module.js:278:25)
>>at Module.require(Module.js:365:17)
>>根据需要(module.js:384:17)
>>在Object.module.exports(/home/user/projects/misc/lfc dev/project/grunfile.js:13:3)
>>在loadTask(/home/user/projects/misc/lfc dev/project/node_modules/grunt/lib/grunt/task.js:325:10)
>>在Task.Task.init(/home/user/projects/misc/lfc dev/project/node_modules/grunt/lib/grunt/Task.js:437:5)
>>在Object.grunt.tasks(/home/user/projects/misc/lfc dev/project/node_modules/grunt/lib/grunt.js:120:8)
>>在Object.module.exports[as cli](/home/user/projects/misc/lfc dev/project/node_modules/grunt/lib/grunt/cli.js:38:9)
>>反对。(/usr/local/lib/node_modules/grunt cli/bin/grunt:45:20)
运行任务:构建
警告:未找到任务“生成”。使用--force继续。
由于警告而中止。
我试过了,
npm安装,
npm安装grunt,
npm安装grunt cli
^^它们也在全球范围内安装。到目前为止,没有任何帮助。日志显示
错误:找不到模块“加载grunt任务”
。您缺少加载grunt任务
。也许它不包含在packages.json中
试一试
还要确保以前没有中断npm安装。如果是这样,请尝试删除
node\u modules
目录,然后再次trynnpm install
。我正在使用linux,它请求以sudo的身份运行命令。
然后砰的一声。。。工作正常。谢谢Ahmad,通过使用sudo:)运行npm安装修复了它。一开始我也打算建议这样做。很高兴你明白了。
npm install --save-dev load-grunt-tasks