Page 1 of 1

nodejs package installs unsupported npm version [Solved]

Posted: Fri Jul 21, 2017 1:47
by twhite
I'm trying to get npm working with nodejs 8.1.2~0. The npm version is 5.0.3 and when I try the following command:

Code: Select all

npm install -g create-react-native-app
I get the following message:

Code: Select all

ERROR: npm 5 is not supported yet
Create React Native App doesn't work with npm 5 yet, unfortunately. We
recommend using npm 4 or yarn until some bugs are resolved.
Is there a previous version of nodejs that has npm 4 and will work?

Re: nodejs package installs unsupported npm version

Posted: Fri Jul 21, 2017 15:37
by twhite
I resolved this by installing yarn, the second suggestion in the message.
Yarn is an alternative to npm.

Code: Select all

npm install yarn -g
Then I ran the create app. The command is slightly different.

Code: Select all

yarn global add create-react-native-app
Success!

Re: nodejs package installs unsupported npm version

Posted: Fri Jul 21, 2017 16:06
by twhite
Spoke too early. As I continued, this doesn't really fix the problem. When I use other commands:

Code: Select all

create-react-native-app project-name
The issues is still there. Evidently that command uses npm.

I guess I'll have to figure out how to install the older 4.X npm.

Re: nodejs package installs unsupported npm version

Posted: Mon Jul 24, 2017 17:38
by twhite
I installed the 4.X npm from npm itself.

Code: Select all

npm install [email protected] -g
the 'X' in 4.X means the latest 4.x version.
It still loads npm 5.0.3 initally, didn't fix the packaging issue, but npm is working fine, no error messages, with the re-installed 4.X version.