til

Today I Learned: collection of notes, tips and tricks and stuff I learn from day to day working with computers and technology as an open source contributor and product manager

View project on GitHub

Configuring NPM

I recently (yesterday) ran into a problem, where I need to use npm command line flag:

  • --legacy-peer-deps

I could use it locally, but I also need to use it on DigitalOceans app platform, so I could control the build.

Luckily you can create a: .npmrc

And you can add the flag the following way:

npm config --location=project set legacy-peer-deps=true

The location can be one of:

  • global
  • user
  • project

The file can for project, as in my case, be committed to the relevant repository.

And for use with DigitalOcean I can now influence the npm execution.

Resources and References