s2i-nodejs-container
s2i-nodejs-container copied to clipboard
Would it be possible to add legacy-peer-deps?
Hi Software Collections. I need install with legacy-peer-deps. Would it be possible to add in assemble this lines of code ?
if [ "$NODE_ENV" != "production" ]; then
echo "---> Building your Node application from source"
if [ "$NPM_MODE" == "legacy-peer-deps" ]; then
echo "---> Installing all dependencies (including peer dependencies) with legacy-peer-deps"
npm install --legacy-peer-deps
else
echo "---> Installing all dependencies"
npm install
fi
@lcanavesio As a temporary solution, you can pass an env variable to the npm. So you can do something like s2i -e npm_config_legacy_peer_deps=true build . my-build-image my-node-app
More info about npm : https://docs.npmjs.com/cli/v9/using-npm/config
The best solution is create a .npmrc file in your project root directory with following content
legacy-peer-deps=true
It will only apply to your current project without impact any others