[BUG] npm link updates package.json to point to local directory (original) (raw)
Current Behavior:
npm link foo-bar updates package.json to point to the local directory of the foo-bar module instead of just symlinking it
Note that foo-bar is a private package installed from git (git+ssh)
Expected Behavior:
npm link foo-bar creates a symlink in node_modules/ without altering package.json
Steps To Reproduce:
- ```
$ cd ./foo-bar && npm link
2. ```
$ cd ../other-package && (cat ./package.json | grep "foo-bar")
"foo-bar": "git+ssh://git@github.com:..." - ```
$ cat ./package.json | grep "foo-bar"`
"foo-bar": "file:../foo-bar",
```
The package foo-bar is now symlinked to the local foo-bar folder instead of the link in npm root -g
Environment:
- OS: Ubuntu 20.04 (WSL)
- Node: 12.9.0
- npm: 7.0.5 (Has been happening with 7.0.0 - 7.0.5 though)