`NODE_PATH` environment variable is ignoredSee original GitHub issue
The “node require.resolve() algorithm” should also search in the directories listed in the
$NODE_PATH environment variable, if it is set. See docs here: https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
resolve library does not implement this step, but I think it should.
I need this because I am running with my local
node_modules directory outside of my project dir, as per this workaround, because my project dir does not support symlinks (a shared folder).
resolve ignores the
$NODE_PATH environment variable,
grunt refuses to run.
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
This is a duplicate of #39; see https://github.com/browserify/resolve/issues/39#issuecomment-306223854.
I wouldn’t suggest using
NODE_PATH for anything; any workaround using it is worse than other alternatives.
I have found a workaround which I think I can live with for now:
- Copy the
project.jsonfile to a temp folder on a different FS
- Copy the resulting
node_modulesdirectory back into the project dir, using
cp -r --dereferenceto expand symlinks into copies.
Ah, I’m not familiar with HGFS; although NTFS certainly supports symlinks.
It does, but they’re not commonly used. I believe that the Windows installers for
npm avoid creating symlinks for that reason. The problem for me is that I am running on Linux and the
npm installers all assume that they are free to create symlinks.
Regarding the “file://” urls and “copy-on-install”, I don’t see how that’s relevant to my goal of running
npm install on a node project that uses
grunt on Linux when my filesystem doesn’t support symlinks, but I suspect we’re talking past each other on that one.
Thanks for your help!