-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Respect NODE_PATH environment variable #6111
Comments
|
Hi @TLATER check this pull #8273 (comment) |
Very cool. Surprisingly tidy and simple, I should have looked at this more closely years ago, been using an ugly hack ever since :) |
This would be useful for using |
@devongovett please support this, some of us like to avoid littering source directories with artifacts like node_modules. they make development environments stateful and unpredictable. |
🐛 bug report
When trying to build with no
node_modules
directory, but all my dependencies in a directory listed inNODE_PATH
, parcel will fail to run because it cannot resolve its plugins.I believe this will also extend to bundling modules from the path, since the module resolution is custom and I can't find any references to
NODE_PATH
in the relevant source files.🎛 Configuration (.babelrc, package.json, cli command)
This can be reproduced with no configuration at all! See the code sample section.
🤔 Expected Behavior
Parcel should resolve modules correctly according to
NODE_PATH
, and in the test case output an empty file (I think, I'll admit I'm too lazy to check what parcel outputs for an empty html file right now).😯 Current Behavior
Parcel complains that even its built-in plugins are missing.
The exact error is:
💁 Possible Solution
Fix the module resolution to respect
NODE_PATH
.🔦 Context
I'm trying to deploy a website on a NixOS host. I'm using node2nix to achieve this, which uses the
NODE_PATH
variable to allow the package manager to take control of thenode_modules
.💻 Code Sample
Easiest reproduction scenario:
mkdir test && pushd test
npm install parcel
node_modules
orpackage*.json
in it as any parent directory up to the root.export NODE_PATH="$(pwd)/node_modules"
popd
touch empty.html
"$NODE_PATH/.bin/parcel" empty.html
🌍 Your Environment
The text was updated successfully, but these errors were encountered: