Home > Software design >  how can I install with tag "legacy-peer-deps" on heroku
how can I install with tag "legacy-peer-deps" on heroku

Time:11-05

I am trying to deploy my app onto heroku, yet I receive a build erorr where it fails to install the dependencies using npm install. Is there anyway I can install with "legacy-peer-deps"?

Thank you so much...

I tried editing my procifile file with the following contents in it

web: npm install --legacy-peer-deps
web: npm start

CodePudding user response:

Ideally, you should resolve the underlying dependency issue so your application works without this option. But tou should be able to configure it by setting environment variable ("config var" in Heroku-speak).

I believe the legacy-peer-deps setting will do the trick:

heroku config NPM_CONFIG_LEGACY_PEER_DEPS=true

Then you'll need to redeploy.

Alternatively, you could add an .npmrc file to your project:

legacy-peer-deps = true

Commit it, then redeploy.

CodePudding user response:

Update:

the new command is:

 heroku config:set NPM_CONFIG_LEGACY_PEER_DEPS=true
  • Related