nodejs package installs unsupported npm version [Solved]

Discussion in general that pertains to Sabayon Linux - Must Pertain to Sabayon Linux

Moderator: Moderators

Post Reply
twhite
Baby Hen
Posts: 13
Joined: Tue Sep 20, 2016 20:57

nodejs package installs unsupported npm version [Solved]

Post by twhite » Fri Jul 21, 2017 1:47

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?
Last edited by twhite on Mon Jul 24, 2017 17:39, edited 3 times in total.

twhite
Baby Hen
Posts: 13
Joined: Tue Sep 20, 2016 20:57

Re: nodejs package installs unsupported npm version

Post by twhite » Fri Jul 21, 2017 15:37

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!

twhite
Baby Hen
Posts: 13
Joined: Tue Sep 20, 2016 20:57

Re: nodejs package installs unsupported npm version

Post by twhite » Fri Jul 21, 2017 16:06

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.

twhite
Baby Hen
Posts: 13
Joined: Tue Sep 20, 2016 20:57

Re: nodejs package installs unsupported npm version

Post by twhite » Mon Jul 24, 2017 17:38

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.

Post Reply