I have a project which contains 2 subprojects:
And both of these projects have their own dependencies mapped in their own packages.json
files, which is placed in each subdir.
So the question is how to run npm install
from sub directories on heroku?
I tried putting something like this in the main npm file
"scripts": {
"postinstall": "cd my_subdir; npm install"
}
But it doesn't work, showing can't cd to my_subdir
Utilize npm's --prefix
option:
"scripts": {
"postinstall": "npm install --prefix ./my_subdir"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With