npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

npm install -- skip modules if the parent/ancestor folders already has the node modules installed

Hi Everyone,

I have an app with the following folder structure:

/var/node_modules/ -> this folder has all the node modules my app needs…
/var/application/react/package.json -> main node app

The node runtime already can find all the packages in the ancestor folder and works fine. but when I run npm install in /var/application/react folder, the npm install installs all the modules locally and doesnt check the /var/node_modules folder which already has all the modules.

Is there a way for me to specify npm install to skip installing node_modules in /var/application/react folder?