What's the correct way to handle packages version #7675
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, thanks for the discussion. NPM (and other package managers) can try to be a little too smart when it comes to frontend, and it will frequently try to install multiple copies of packages so as to introduce the fewest code path changes possible. This is great for servers, however, for client code, it's usually unwanted. You may need to use tools like dedupe or resolutions in order to get back to a single copy of a given package. Another option, you could delete just the entries in your lock file, but make sure you delete node_modules as when the reinstall takes place, if you have any node_modules locally, it will try to use those to resolve so it installs faster. You can also delete node_modules and your entire lock file for the nuclear option. |
Beta Was this translation helpful? Give feedback.
Hi, thanks for the discussion.
NPM (and other package managers) can try to be a little too smart when it comes to frontend, and it will frequently try to install multiple copies of packages so as to introduce the fewest code path changes possible. This is great for servers, however, for client code, it's usually unwanted.
You may need to use tools like dedupe or resolutions in order to get back to a single copy of a given package. Another option, you could delete just the entries in your lock file, but make sure you delete node_modules as when the reinstall takes place, if you have any node_modules locally, it will try to use those to resolve so it installs faster. You can also delete nod…