Explicitly set the folder for npm install in using the --prefix flag to prevent installation into the wrong folder.
Reason for change
In the current install_npm_deps script, we cd into the assets folder then perform the installation. This won't always work because if a package.json does not already exist in the assets folder, npm will look for the nearest parent folder containing either a package.json file or a node_modules folder and do the installation there.
Using the --prefix flag will force installation in the specified folder.
Summary
Explicitly set the folder for
npm
install in using the--prefix
flag to prevent installation into the wrong folder.Reason for change
In the current
install_npm_deps
script, wecd
into theassets
folder then perform the installation. This won't always work because if apackage.json
does not already exist in theassets
folder,npm
will look for the nearest parent folder containing either apackage.json
file or anode_modules
folder and do the installation there.Using the
--prefix
flag will force installation in the specified folder.