Cant install deep nested node js modules

118 Views Asked by At


I'm trying to install nightmare module to my project but i'm facing some problems.
When i run npm install nightmare --save it all works , and npm returns OK but visual studios says that i reached the max character limit , because of nightmare deeply nested dependencies.The project is already in the shortest path , but the modules still go over the character limit.

Im running windows 10 x64 bit , node v 4.1.0 , npm 2.14.3, visual studios 2015 community with NTVS 1.0 .

I know its a common bug and i searched the web for it , but couldn't find a proper solution.Help is much appreciated

Cheers!

2

There are 2 best solutions below

0
David Barishev On BEST ANSWER

Well i installed the latest npm and it fixed it for me. The npm 3 will install all modules in the parent folder , but remembers the 'tree'.

2
Alexander Zeitler On

Use Windows subst command to create a virtual drive letter for your source code folder containing the nested node_modules folders:

subst s: c:\path\to\my\long\folder\structure\code\

Then try to open your project in Visual Studio from drive s:\