You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you run webpack-cli with NODE_PATH (and not with node_modules in local directory) you end up with request to install dependencies even though everything is properly configured, i.e. NODE_PATH=<includes all webpack and webpack-cli dependencies> webpack-cli -config <config> build
What is the current behavior?
You get prompted for
[webpack-cli] For using 'build' command you need to install: 'webpack' package.
[webpack-cli] Would you like to install 'webpack' package? (That will run 'npm install -D webpack') (Y/n)
To Reproduce
Steps to reproduce the behavior:
I believe this will happen in any case where you have webpack installed in a sibling directory than your current working directory which you refer to using NODE_PATH
Expected behavior
webpack-cli should only ask to install dependencies if they don't exist and not when webpack can't find them in local directory
Screenshots
Please paste the results of npx webpack-cli info here, and mention other relevant information
Additional context
I believe this bug has been introduced in #2761 where the previous logic looked to be correct (at least reverting to that logic makes NODE_PATH packages work)
The text was updated successfully, but these errors were encountered:
robert3005
changed the title
Cli should respect NODE_PATH when checking for existence of a package
Should respect NODE_PATH when checking for existence of a package
Jul 30, 2022
This PR is workaround for limitation when you use npm/yarn and a package doesn't exits in the installation time, anyway feel free to fix code and respect NODE_PATH
Describe the bug
If you run webpack-cli with NODE_PATH (and not with node_modules in local directory) you end up with request to install dependencies even though everything is properly configured, i.e.
NODE_PATH=<includes all webpack and webpack-cli dependencies> webpack-cli -config <config> build
What is the current behavior?
You get prompted for
To Reproduce
Steps to reproduce the behavior:
I believe this will happen in any case where you have webpack installed in a sibling directory than your current working directory which you refer to using NODE_PATH
Expected behavior
webpack-cli should only ask to install dependencies if they don't exist and not when webpack can't find them in local directory
Screenshots
Please paste the results of
npx webpack-cli info
here, and mention other relevant informationAdditional context
I believe this bug has been introduced in #2761 where the previous logic looked to be correct (at least reverting to that logic makes NODE_PATH packages work)
The text was updated successfully, but these errors were encountered: