Sometimes `npm install` deletes linked module, replaces it with downloaded module.

What I Wanted to Do

run npm install in a project, but don’t delete linked modules.

What Happened Instead

Running npm install undid the previous npm link module. It replaces the symlink with an actual folder (f.e. the one downloaded from npm registry).

Reproduction Steps

npm link something, then run npm install in the project, which will effectively unlink something.

Details

I’m not sure if this happens every time. I just know it does.

Platform Info

$ npm --versions
{ '@mapperai/mapper-annotator': '1.7.1',
  npm: '6.9.0',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '34.0',
  http_parser: '2.8.0',
  icu: '63.1',
  llhttp: '1.1.1',
  modules: '67',
  napi: '4',
  nghttp2: '1.37.0',
  node: '11.14.0',
  openssl: '1.1.1b',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.27.0',
  v8: '7.0.276.38-node.18',
  zlib: '1.2.11' }
$ node -p process.platform
darwin

(Please provide some specific reproduce steps if you do identify a reproducible scenario.)

I made a video: https://youtu.be/-udkgr5aLFY

It also shows the problem in the other bug: Npm deletes stuff from linked module's node_modules.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.