NPM link keeps pulling old version even after npm clean cache --force, unlink, rm -rf node_modules, etc

Viewed 1003

I have a package foo, which I want to symlink and use the local version of foo in package bar.

Normal process should be (I think)

  1. in foo run sudo npm link

  2. in bar run sudo npm link foo

Done

Bar keeps pulling an old version of foo however, not the version that is on my local machine. This old version doesn't appear to exist anywhere and isn't the live verison

I have tried

npm clean cache --force

in foo:

npm unlink
rm -rf node modules, rm -rf build, rm -rf dist, rm -rf package-lock.json 
npm build
npm link

in bar:

npm link foo
rm -rf node modules, rm -rf build, rm -rf dist, rm -rf package-lock.json 
npm build

Bar still ends up with the old version of foo that is neither the current local version or the live version. Where could this old version be living, and why does it keep coming back?

1 Answers
Related