Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid nesting of "node_module" directory?

Tags:

node.js

In some cases, that comes into conflict with the Windows 260 chr path limitation. I'm having a lot of problems with npm install and this limitation.

.
├── app
│   └── node_modules
│       └── submodule
│           └── node_modules
│               └── submodule
│                   └── node_modules
│                       └── submodule
│                           └── node_modules
│                               └── submodule
│                                   └── to_infinity_and_beyond... 
│                                       └── It's a madness! 

...

That structure produces paths like:

c:/path_to_my_app/ node_modules/sub_module/node_modules/sub_module/node_modules/sub_module/node_modules/sub_module/node_modules/sub_module/node_modules/sub_module/node_modules/sub_module/node_modules/sub_module/node_modules/sub_module/node_modules/sub_module/.....

What i'm doing wrong? It's there a way to avoid it?

Perhaps renaming "node_module" to "nm", or something like that, may helps to save some characters...

That's in advance!

like image 463
alfonsomartinde Avatar asked Jun 30 '13 23:06

alfonsomartinde


1 Answers

As Brandon Tilley said:

npm dedupe

works fine for me!

like image 88
alfonsomartinde Avatar answered Sep 23 '22 03:09

alfonsomartinde