Bug: NPM not working correctly


Starting tonight, npm is acting very strange.

1: the node command in the machine section is taking a LONG time to decide if it is installed
2: npm install seems to fail.
3: sudo npm says it doesn’t exist


If you need to authenticate with npm before downloading the
dependencies, you could store the npm credentials in the
secure environment
and then use the following script to perform the authentication:

set -o nounset
set -o errexit

npm login <<!
1 Like

good tip, but i’m not trying to login to npm at all, this is npm install, not npm publish.

If you are able to login to npm without any error confirms that there is no error in dependencies: cache_directories .
If it throws an error then i believe you have to clear the cache directories where NPM is installed . Please refer this : https://circleci.com/docs/how-cache-works .

I tried the ‘without cache’ build option, so I don’t think it is a cache issue, and I’m still not sure why I would need to login to npmjs if I’m not using private modules. (what if I didn’t have an account there?)

Either way, it was likely a connection issue somewhere between npmjs and the build chain, the issue has resolved itself.