`NODE_PATH` environment variable is ignored
See original GitHub issueThe “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
Currently, the 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).
Because resolve
ignores the $NODE_PATH
environment variable, grunt
refuses to run.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
node.js - NODE_PATH is being ignored or not working
I'm trying to run my node app on a new server and am having some issues with the NODE_PATH environment variable. The app...
Read more >Node.js – NODE_PATH is being ignored or not working
I'm trying to run my node app on a new server and am having some issues with the NODE_PATH environment variable. The app...
Read more >Configuration - Quokka.js
This setting is ignored on non-Windows environments. If configuring a custom version of node , the path must refer to a version of...
Read more >API - esbuild
The build API call operates on one or more files in the file system. ... Conditions; Drop; Entry names; Footer; Global name; Ignore...
Read more >NodePath — Godot Engine (stable) documentation in English
A pre-parsed relative or absolute path in a scene tree, ... Exporting a NodePath variable will give you a node selection widget in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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:
project.json
file to a temp folder on a different FSnpm install
therenode_modules
directory back into the project dir, usingcp -r --dereference
to expand symlinks into copies.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 thenpm
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 usesgrunt
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!