-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG](arborist) should not remove global node_modules #4274
Comments
Global modules must not be shared between node versions, for a number of reasons, including that they might be compiled. |
My global node_modules are not shared between node versions. After switching Node.js version, the node_modules points to different path. That's why our global node_modules is symlink. |
Typically the way this is done with a node version manager is to move the node_modules folder in its entirety, not with a symlink, or to locate it somewhere else. See |
How do we move a local per-project |
@tophf a hard link? generally you don't; a local project, including its node_modules folder, should be kept all on the same drive and in the same location. |
How do we make a hardlink for a directory in Windows, which can only make junctions or symlinks? |
Closing as duplicate of #4358 |
What / Why
For switching different Node.js version, we use symlink for global node_modules.
$ ls -ld /usr/local/lib/node_modules /usr/local/lib/node_modules -> /var/packages/Node.js_v16/var/node_modules
The global module directory and npm itself is removed after installing global module.
The behavior have been changed from npm/arborist@f2b0cee.
How
Current Behavior
Steps to Reproduce
npm install -g <any module>
Expected Behavior
Allow global node_modules be symlink.
The text was updated successfully, but these errors were encountered: