-
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
[BUG] npm install does not honor packages installed with --install-links #5965
Comments
I have a similar problem in npm 9, where I explicitly use Maybe something like this: // package.json
"dependencies": {
"my-linked-package": "file:../my-linked-package@link",
"my-installed-package": "file:../my-installed-package@install"
} |
After updating npm from 8 to 9.2.0 version I can't install local packages with symlinks. E.g. I have a local package "react-ui" with some React components. When I run command "npm i ../../_packages/react-ui" in other project, I used to have
section in package.json and this section
in package-lock.json. Files of "react-ui" package weren't copied to the "node_modules" folder of another project. It was very handy, because I don't have to run update every time I change "react-ui" package. But now command "npm i ../../_packages/react-ui" copies all files to the "node_modules" folder of the project. |
But according to [npm docs](the symlink disappears and my package is installed again because install-links defaults to true since npm 9) the default value is |
The default value of When reinstalling packages based on the (I agree that @fardolieri's problem might be a different issue from the original bug) |
It looks like it was changed back last week #6142. That probably fixes my issue. I'll try it out next week and I hopefully don't forget to give you guys an update. |
As you said, we reverted this recently. Please re-open this issue if it is still a problem. |
@fritzy
Please note that for npm to install the package as a copy and not a link, we need to specify I expect the latest |
Is there an existing issue for this?
[BUG] npm install removes linked packages, npm link replaces linked package contents #2380 seems similar but is a 7.x bug and predates the
--install-links
option.This issue exists in the latest npm version
Current Behavior
Installing a package with
--install-links false
, deletingnode_modules
, then runningnpm install
reinstalls the module as a link and updatespackage-lock.json
Expected Behavior
npm install
should honor and not changepackage-lock.json
, the package should be copied, not linkedSteps To Reproduce
At step 4:
d---- 2022-12-14 12:21 PM child
At step 5:
At step 8:
l---- 2022-12-14 12:23 PM child -> <REPO>\child\
At step 9:
Environment
The text was updated successfully, but these errors were encountered: