Clearing NPM Cache after upgrade

rails
nodejs

#1

The main problem we’re having is even though we perform a pre: rm -rf node_modules/ or a Rebuild without cache the problematic fsevents seems to come back when we push a new commit.

  1. The stack you’re using
    Rails with NPM

  2. The exact error message you are getting
    When node_modules is loaded from the cache, it always seems to be an old version.
    This causes npm install to fail because it’s trying to load fsevents which is for OSX only but due to a different problem made it into the npm-shrinkwrap.json. It’s been removed, but for it’s still cached in Circleci.

  3. Which troubleshooting steps you’ve already taken
    We have to Rebuild without cache or perform a pre: block that rm -rf node_modules/.
    But it never seems to be saved for the next run?

  4. Any recent changes either in the codebase or the stack
    Yes, we upgraded a number of node_modules and updated the npm-shrinkwrap.json

  5. What happens when you run the tests locally
    Works fine.

  6. What is supposed to happen when your build runs
    npm install runs properly (instead of failing)

Thanks,
Justin


#2

try doing:

dependencies:
  override:
    - npm update

#3

We’ve also got ruby + npm and a similar problem, except bundler failing instead of npm. Something seems to be broken in the circle cache lookup.

It may help to clear the project cache through the api (missing from the web app): https://circleci.com/docs/api/#clear-cache

curl -X DELETE https://circleci.com/api/v1/project/:username/:project/build-cache?circle-token=:token


#4