javascript - grunt 找不到模块 'coffee-script'

标签 javascript node.js coffeescript 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 - setting up mean.io cannot find module errors

Cannot find module 'coffee-script'

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

最佳答案

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

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

关于javascript - grunt 找不到模块 'coffee-script',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23622179/

相关文章:

javascript - 具有多个字段的 jquery ui 自动完成

javascript - 通过在 Openlayers 中按住 ctrl 来启用绘图功能

javascript - 自定义下载名称 <a href> 标签

javascript - 使用 Node 在rehindb中插入错误

javascript - express-fileupload 模块将损坏的图像文件保存到我的硬盘的奇怪问题

javascript - scrollTop() 在 chrome 中返回 0

javascript - Firebase 的云功能 - 删除或添加数据

Coffeescript:处理实例类方法的更好方法

javascript - 确定对象属性名称是否为数字

javascript - 将正则表达式与 CoffeeScript 中的模板相匹配