Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install is missing modules

Before I can run gulp in my project I need to run npm install. This works except on my computer, because I get the following error:

Error: Cannot find module 'socket.io'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    ...

I can fix this with

$> npm install socket.io

Now when I do the install command again I get

Error: Cannot find module 'di'
    ...

When I install di and run the install command again I get:

Error: Cannot find module 'log4js'

I think that this might continue for a very long time. Any suggestions what is going on here and how to fix this ?

like image 322
Jeanluca Scaljeri Avatar asked Jul 09 '14 11:07

Jeanluca Scaljeri


2 Answers

I've faced the same problem when bootstrapping a MEAN application and add each missing dependencie with npm install packageName --save was not an option so I came across to npm-install-missing whom has saved my life :)

Installation

npm install -g npm-install-missing

Usage

npm-install-missing
like image 164
Rafael Rocha Avatar answered Oct 20 '22 12:10

Rafael Rocha


Running npm install will install all dependencies that are specified in the package.json. Seems like you have quite a few dependencies that are not defined that way. Use npm install packageName --save and npm will add the package to your package.json.

like image 29
jgillich Avatar answered Oct 20 '22 12:10

jgillich