执行grunt命令报错 Cannot find module 'coffee-script'

Failed to list grunt tasks in yudian-frontend-salesplatform\Gruntfile.js: process finished with exit code 1 (a non-zero exit code means an error)
* Edit settings

$ "C:\Program Files\nodejs\node.exe" C:\Users\admin\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt --no-color --verbose --gruntfile C:\Users\admin\Desktop\front\yudian-frontend-salesplatform\Gruntfile.js --tasks "C:\Program Files\JetBrains\IntelliJ IDEA 2018.3.3\plugins\JavaScriptLanguage\grunt_js\tasks" _intellij_grunt_tasks_fetcher
internal/modules/cjs/loader.js:582
throw err;
^

Error: Cannot find module 'coffee-script'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (C:\Users\admin\Desktop\front\yudian-frontend-salesplatform\node_modules\_grunt@0.4.5@grunt\lib\grunt.js:16:1)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)

Process finished with exit code 1

 

尝试的解决方案:

 

cnpm install coffee-script --save-dev
还是不行的话:就删除 项目中 node_modules 目录,重新 cnpm install


Stack Overflow:
https://stackoverflow.com/questions/23622179/grunt-cannot-find-module-coffee-script

 

转载于:https://www.cnblogs.com/hui-run/p/10374290.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值