The docs say that installing a dependency with a local path (e.g. npm install ../module --save
) will normalize the dependency to a relative path in package.json, e.g.
"dependencies": {
"bar": "file:../foo/bar"
}
However, this appears to not be the case with v3+ as someone mentioned here.
This is how my path looks after npm install ../myModule --save
:
"dependencies": {
"bar": "file:///home/aFolder/Documents/git/project/modules/myModule"
}
This path will only work on my system, and thus I need the relative path as seen in the first example. Seems like it would be a pretty common use case.
Is it possible to save dependencies with relative paths?