npm Community Forum (Archive)

The npm community forum has been discontinued.

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

file:../ dependencies does not work with peerDependencies

I have the following problem my package.json and so the node_modules folder is not a parent of the child dependency e.g.:

"dependencies": {
    "mobx": "^4.0.0",
    "sulu-admin-bundle": "file:./../../vendor/path/to/subpackages/"

As sulu-admin-bundle has peerDependencies (mobx, …) and I defined some babel plugins in my root package.json the are not found for my subpackages as my root package.json is no parent folder of the subpackage I require.

How can I solve it is it als possible that the npm install does a copy instead of a symlink for the file:… so npm works correctly also for file:…/.

The only solution I found was creating 2 symlinks which is really strange:

"scripts": {
    "preinstall": "npm install symlink-dir --save-dev && symlink-dir ../../vendor vendor",
    "postinstall": "symlink-dir node_modules ../../vendor/node_modules"
"dependencies": {
    "sulu-admin-bundle": "file:vendor/path/to/subpackages/"

A solution would also be that in the subpackage …/…/vendor/path/to/subpackages/ the node_modules folder is the same as in my root package.json.

This does not follow the bug report template. As per our policy for handling #bugs, I’m moving this to #support.