Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I install with tag "legacy-peer-deps" on heroku

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
like image 317
BorutoHazingo Avatar asked Oct 12 '25 09:10

BorutoHazingo


1 Answers

Ideally, you should resolve the underlying dependency issue so your application works without this option. But you 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:set 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.

like image 97
Chris Avatar answered Oct 16 '25 11:10

Chris