4

I have set up a private NPM registry (proxy) and I wanted all my project packages (that are listed in package-lock.json) to be reinstalled from there but it seems that NPM keeps installing from public registry. I tried clearing/deleting package-lock.json - I got all packages downloaded from private repo but then got completely different versions of packages installed (minor versions raised to newest). That causes me troubles as many packages are incompatible (although minor version differences shouldn't have braking changes).

I there a way to get exact same versions from package-lock.conf but from different registry and without specifying exact versions in package.json?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Rytis Alekna
  • 1,387
  • 7
  • 17

1 Answers1

0

I was moving to a new machine, so I had created a new access token in the new registry, and set up my new .npmrc file with this access token and my email address.

I backed up my existing package-lock.json (it was in git anyway), and deleted it. Then I ran npm install. And everything was corrected in the new package-lock.json file.

Preet Sangha
  • 64,563
  • 18
  • 145
  • 216