npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

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.


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: '',
  zlib: '1.2.11' }
$ node -p process.platform

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

I made a video:

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