找不到模块'coffee-script'

grunt Cannot find module 'coffee-script'

本文关键字:coffee-script 模块 找不到      更新时间:2023-09-26

我使用以下命令来安装mean stack并创建一个应用程序:

> 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 -设置平均值。IO无法找到模块错误

找不到module 'coffee-script'

我还清除了npm缓存并重新安装了几次。

  1. 删除node_modules目录
  2. npm cache clean清空下载的临时依赖项,以防万一。
  3. npm install,运行时最好不要中断。

这些为我解决了大部分问题。

这对我有用:

npm install --save-dev coffee-script
node -v # v0.10.31

我遇到了同样的问题,在日志的末尾,我收到了这样的消息:

...
http 200 http://registry.npmjs.org/-/all
Killed

问题是我的VM缺少足够的内存。这里提到的一个解决方案是使用swap。