NPM Setting and Saving Local Relative Path

I am trying a npm install

local package .tgz

to distribute common Angular components.

npm install ./../@company/my-package-0.10.0.tgz --save


The problem is that the above code is storing the full path in package.json



"@company/package": "file:///C:\\...\\my-package-0.10.0.tgz"


This creates a source control issue for other developers on my team, since we don't have all sources installed in the same location.

How can I do to npm

save the relative path of a file in package.json

using a command npm install

? I don't want to package.json

manually modify the file and run a full npm install every time the component package is updated.


To clarify, this is the end result I want:


npm install ./../@company/my-package-0.10.0.tgz --save


"@company/package": file:./../@company/my-package-0.10.0.tgz


source to share

All Articles