[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:

  1. ```

$ cd ./foo-bar && npm link

2. ```  
 $ cd ../other-package && (cat ./package.json | grep "foo-bar")  
 "foo-bar": "git+ssh://git@github.com:..."  
  1. ```

$ 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: