-
Notifications
You must be signed in to change notification settings - Fork 3.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
Regression? Change? Can no longer install a single package without all the other dependencies in package.json #3023
Comments
Just curious, why do you need If you just do |
@ljharb none if those options are needed; I just used them as a sanity check. Running just |
npm 7 always does its best to work on full package trees rather than individual packages. that is, we do our best to ensure that what's on disk in your when adding a package, we add it to the dependency tree in your package.json, and then make your if you have a use case for it, you may consider opening an rfc or a discussion at https://github.com/npm/rfcs |
Thanks @nlf, created npm/rfcs#364. |
See npm/cli#3023 for more details. On Node v16, it appears that --no-package-lock is no longer supported.
I agree with @dandv that the behavior observed in npm |
I have just run into this with an authenticated package. We have a package Because of trying to install everything in package.json it fails with a 401 when trying to install from the private repo when all the user wants to install initially is the aws package. We could install it globally but then we lose versioning etc. |
If a `package.json` file exists, NPM will always install every dependency specified in it, even if using `npm install` to install only a single specific package. Related GitHub issue: npm/cli#3023
Current Behavior:
Running
npm install <package> --no-package-lock --production --no-save
will still install all otherdependencies
listed inpackage.json
.Expected Behavior:
This did not use to be the case with npm 6. NPM 6 would install only the requested package.
Steps To Reproduce:
npm install cheerio
# this will install 14 packages innode_modules
rm -rf node_modules package-lock.json
npm install local-iso-dt --no-package-lock --production --no-save
This will output
added 15 packages
, and node_modules does contain all thecheerio
dependencies, instead of just the zero-dependencylocal-iso-dt
module.Environment:
Related
The text was updated successfully, but these errors were encountered: