The only way that i found to work for the moment is to have a package.json like this:
"scripts": {
"postinstall" : "node fallbackDependencies.js"
}
"dependencies": {
"app.core": "git+ssh://git@repo.mydomain.com:group/app-core.git#v0.1.1"
},
"optionalDependencies": {
"app.core": "0.1.1"
}
And in the fallbackDependencies.js
file to run a script that takes all the dependencies from the package.json which are also in the optionalDependencies
and for each of them check if there is a folder with that name in the node_modules
folder. If there is no folder then run npm install <json.dependencies[x]>
.
This is the only temporary solution that i could think of.
If someone has a better approach to this please feel free to answer.