Keep symlinks when running `npm install`
Asked Answered
C

0

11

If we do:

npm link x

and then we run npm install, it will overwrite the symlinked package.

Is there a way to run npm install without overwriting a symlinked package? something like:

npm install --preserve-symlinks

or

npm install --keep-symlinks

here is the issue in the NPM issue tracker:
https://github.com/npm/npm/issues/17287

Compartment answered 22/8, 2018 at 23:51 Comment(7)
Have you tried npm install --no-delete-symlinksCynosure
is there documentation for that option?Compartment
I'm afraid not, I once suffered from this issue, it must've sticked in my mind after never-ending searches.Cynosure
supposedly NPM version 7 will solve this...for now yarn install should work.Compartment
I saw this repo buried in the comments of your npm issue link: github.com/UD-UD/npm-safe-installTenfold
Did someone found solution for this?Office
perhaps the best solution is run npm install and then re-link everything afterCompartment

© 2022 - 2024 — McMap. All rights reserved.