-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
🎉 npm i npm -g will now install npm@9 🎉
Breaking Changes
- For a full list of the breaking changes, see this GitHub Changelog post or the initial
[email protected]release
Migration Guide
Installing symlinked local dependencies
npm@9 changed the default value of install-links from false to true.
This means that npm will now attempt to install directories by default instead of symlinking them.
Note that workspaces will always be symlinked, so the latest workspaces changes will always be reflected in your package.
How to turn it off
You can run the following to set the previous behavior on a per-project basis:
npm config set install-links=false --location project
Compatibility with npm@6
npm@9 changed the lockfile-version for new projects from 2 to 3.
If you are creating a new project and want to maintain compatibility with npm@6 you will need to downgrade your lockfile-version to 2. Existing projects will not have their lockfile-version number changed.
To set a project specific lockfile-version run:
npm config set lockfile-version=2 --location project
Known Issues
ENOENT package.json Errors
Note:
If you get this error, try running the command with--install-links=false
npm@9 has changed the default of the install-links flag to true. This means that when running npm install with a directory as the argument (such as npm install ../path/to/local-package), npm will attempt to install that directory into the node_modules/ directory just like any other package, instead of creating a symlink like it would previously.
We are tracking a fix (ref: #5820) for a known issue where transitive local directory dependencies can cause this error.
Workaround
To workaround this issue, run either of the following:
npm install --install-links=falseto run a single install that will create symlinksnpm config set install-links=false --location projectto set this as a default for your project in its local.npmrc file
Other Issues
If you find other issues with v9, use the Bug v9 Issue Template to open a new issue.