Question

I used the following commands to install a mean stack and create an app:

> 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

but when I get to the final grunt command I get the error:

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)

I've tried various solutions on stackoverflow to no avail:

NodeJS - setting up mean.io cannot find module errors

Cannot find module 'coffee-script'

I also cleared npm cache and reinstalled a few times.

Was it helpful?

Solution

  1. Remove node_modules directory.
  2. npm cache clean to empty downloaded temporary dependencies, just in case.
  3. npm install again, and better not to interrupt it while running.

These solved most of these problems for me.

OTHER TIPS

This worked for me:

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

I had the same problem, and in the end of the log I was receiving such a message:

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

The problem was the lack of enough memory in my VM. One solution was to use swap is mentioned here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top