0

I am using node.js and gradle to do stuff.

After installing the needed libraries i end up with a very long recursive directory structure.

Example:

C:\workspace\KCode\node_modules\google-closure-compiler\node_modules\gulp-util\node_modules\dateformat\node_modules\meow\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\load-json-file\node_modules\parse-json\node_modules\error-ex\node_modules\is-arrayish\.editorconfig

These long paths cause several problems. Many tools / programs do not support such long paths.

For example the windows file history feature complains about it:

Die Datei wurde nicht gesichert, da ihr vollständiger Pfad das MAX_PATH-Limit übersteigt oder nicht unterstützte Zeichen enthalten sind:
Wenn die Datei geschützt werden soll, verwenden Sie kürzere Verzeichnis- und Dateinamen.

(Sorry, I don't have the english message.)

Question 1: Is there a way to flatten or shorten this directory-structure?

Question 2: Is there a way to declare a system-wide location where to put these things (and share them between different projects)?

Frederic Leitenberger
  • 1,949
  • 24
  • 32

1 Answers1

0

I found a solution here: How to deploy Node.js application with deep node_modules structure on Windows?

The new version of npm v3 flattens these directory structures: https://github.com/npm/npm/releases/tag/v3.0.0

But Question 2 remains unanswered.

Community
  • 1
  • 1
Frederic Leitenberger
  • 1,949
  • 24
  • 32