I check in and push a package-lock.json file that contains links to e.g. “https colon slash slash registry dot npmjs dot com.” When I push this file and run “npm install” using NPM 6, the links in the file update to use “http colon slash slash registry dot npmjs dot com.” (I’m not allowed to post links on this forum; infer what I meant to type)
Do you have any idea why this would happen? It does not happen on my laptop or in any other test environment.
Hi @kevinburke - I don’t think I have the full picture, as I am not able to recreate this using the provided CircleCI image.
docker run -it circleci/node:8.9.4-browsers bash
cd ~ && git clone https://github.com/cBioPortal/cbioportal-frontend.git
cd cbioportal-frontend
npm install
cat package-lock.json | grep 'http:' #no results
The package-lock.json file is still using https for all the registry links. I also ran this on my circleci aws instance and did not have the URLs replaced.
Do you know if this happens consistently? Is there anything else about the environment that you suspect might alter behavior?
Hey Eddie, thanks for looking into the issue. We’re actually using the node 10 image for our repo and can’t think of what would cause the flakey protocol used to resolve dependencies other than the registry being set differently than what we are using on our dev environments (using the default HTTPS).
Here’s our configuration (including the http --> https fix)
I don’t know if upping the provided npm 5.6 to 6.1 would have any impact, but I’m still not able to re-create the behavior. Based on some searching though it seems npm 6+ changes the behavior of package resolution (stricter hash matching) and package-lock.json format. It might be worth taking your ask to a specific npm community, or someone here might have other thoughts.