Downgrade npm fails

43 views
0

I’m trying to downgrade npm on my mac to version 4.6.1 so that I can create a React Native App.

Currently, I’ve installed Node and npm from the Node website.

My Node version is: v8.9.1

My npm version is: 5.5.1

I’m running the following command to downgrade:

 npm install -g npm@4.6.1

I get the following errors:

npm WARN checkPermissions Missing write access to /Users/dev/.npm-packages/lib/node_modules/npm
npm ERR! path /Users/dev/.npm-packages/lib/node_modules/npm
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access '/Users/dev/.npm-packages/lib/node_modules/npm'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/dev/.npm/_logs/2017-12-04T18_48_43_123Z-debug.log

I’ve tried to uninstall and re install node several times. The directory clearly exists when I go to node_modules, however when I try to cd into it I get an error:

No such file or directory

I’ll probably try to use yarn – but I’d like to be able to get this working too.

Edit: yarn allows me to create a react native app.