s2i-nodejs-container icon indicating copy to clipboard operation
s2i-nodejs-container copied to clipboard

Would it be possible to add legacy-peer-deps?

Open lcanavesio opened this issue 3 years ago • 2 comments

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 avatar Nov 04 '22 04:11 lcanavesio

@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

pacostas avatar Nov 14 '22 10:11 pacostas

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

kunyan avatar Nov 23 '22 13:11 kunyan