CircleCI-Public / node-orb

An orb for working with Node.js on CircleCI
https://circleci.com/orbs/registry/orb/circleci/node
MIT License
52 stars 80 forks source link

Install Job Fails - Out of sync #181

Closed jcuffney closed 1 year ago

jcuffney commented 1 year ago

Orb version:

5.1.0

What happened:

continuously get the following error in CI - but not locally. Obviously the error is stating what needs to be done - but after removing node_nodules / package-lock.json and re installing I still get the same error. Also I see other teammates machines work as expected which makes me think it might have something to do with my machine specifically. I am doing this on a M1 Mac if that is at all relevant. LTS versions of Node and NPM installed via nvm.

`npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.

Expected behavior:

I expect npm ci to succeed in the install step as it does when installed from other machines.

Additional Information:

Screenshot 2023-03-01 at 10 28 46 AM Screenshot 2023-03-01 at 10 29 20 AM

jcuffney commented 1 year ago

not sure why - but this was the only was I was able to fix this for anyone who comes across this in the future.

$ cd <project_directory>
$ rm -rf package-lock.json npm-shrinkwrap.json node_modules
$ npm cache clean --force
$ npm cache verify
$ npm install

will close this out unless I see it again and this doesn't fix it.