file:../ dependencies does not work with peerDependencies

cli
help-wanted

(Alexander Schranz) #1

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.


(Kat Marchán) #2

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


Problem with Peer Dependencies and linked dependencies
(system) #3

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.