我使用以下命令安装平均堆栈并创建应用程序:
> sudo npm install -g meanio@latest // Get the mean cmdline
> mean init myApp // create your first app
> cd myApp && npm install // Install dependencies
> grunt // Launch mean
但是当我到达最后的 grunt 命令时,我得到了错误:
module.js:333
throw err;
^ Error: Cannot find module 'coffee-script'
at Function.Module._resolveFilename (module.js:331:15)
at Function.Module._load (module.js:273:25)
at Module.require (module.js:357:17)
at require (module.js:373:17)
at Object.<anonymous> (/home/eddie/ResFour/node_modules/grunt/lib/grunt.js:16:1)
我在 stackoverflow 上尝试了各种解决方案,但无济于事:
NodeJS - setting up mean.io cannot find module errors
Cannot find module 'coffee-script'
我还清除了 npm 缓存并重新安装了几次。
最佳答案
- 删除
node_modules
目录。 npm cache clean
清空下载的临时依赖项,以防万一。npm install
再次运行,最好不要在运行时中断它。
这些为我解决了大部分问题。
关于javascript - grunt 找不到模块 'coffee-script',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23622179/