Create-react-native-app: Error creating new app with "create-react-native-app"

Created on 26 May 2017  Â·  44Comments  Â·  Source: expo/create-react-native-app

Description

I tried to create a new react native app using the command "create-react-native-app"
I'm using window 8.
I got the following terminal error

D:\project>create-react-native-app crna
Creating a new React Native app in D:\project\crna.

Installing packages. This might take a couple minutes.
Installing react-native-scripts...

npm WARN deprecated [email protected]: Use mz or fs-extra^3.0 with Promise Suppor
t
npm WARN deprecated @exponent/[email protected]: Please switch to @expo/spawn-as
ync, the new name of this package. It's the same code with our new name.
npm ERR! shasum check failed for C:\Users\ui-admin\AppData\Local\Temp\npm-3204-a
eacedd1\registry.npmjs.org\_40exponent\ngrok\-\ngrok-2.2.7.tgz
npm ERR! Expected: 37fe66f922b1003da2a78c66b7d4d3bc9313e423
npm ERR! Actual:   d134060eb730b880da06d5c040ca933f6a75b613
npm ERR! From:     https://registry.npmjs.org/@exponent/ngrok/-/ngrok-2.2.7.tgz

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ui-admin\AppData\Roaming\npm-cache\_logs\2017-05-26T09_36_
04_379Z-debug.log
`npm install --save-dev --save-exact react-native-scripts` failed

Any one met this error or fix it

awaiting-reply

Most helpful comment

  1. install npm 4.6.1 or yarn 0.24.5
  2. run npm cache clean or yarn cache clean
  3. install create-react-native-app globally
  4. run create-react-native-app some-project-name

let me know if you still have this error. anyone who replies and does not clearly say "i tried the 4 steps" and indicate whether it was yarn or npm or both, then i will delete your comment, sorry.

All 44 comments

same problem

Same problem using Ubuntu 16.04 (LTS).

jimmy@AppDev:~$ create-react-native-app my-app
Creating a new React Native app in /home/jimmy/my-app.

Installing packages. This might take a couple minutes.
Installing react-native-scripts...

npm WARN deprecated [email protected]: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated @exponent/[email protected]: Please switch to @expo/spawn-async, the new name of this package. It's the same code with our new name.
npm ERR! Linux 4.8.0-53-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save-dev" "--save-exact" "react-native-scripts"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10

npm ERR! shasum check failed for /tmp/npm-2099-bef3060c/registry.npmjs.org/_40exponent/ngrok/-/ngrok-2.2.7.tgz
npm ERR! Expected: 37fe66f922b1003da2a78c66b7d4d3bc9313e423
npm ERR! Actual:   f7910be80cff8831a1570098b0fe0df4dab27be0
npm ERR! From:     https://registry.npmjs.org/@exponent/ngrok/-/ngrok-2.2.7.tgz
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/jimmy/my-app/npm-debug.log
`npm install --save-dev --save-exact react-native-scripts` failed
jimmy@AppDev:~$ 

try running npm cache clean or yarn cache clean, it seems like one of the tar downloads was interrupted

Even i am facing the same issue. npm cache clean is also not working for me

which version of npm are you using?

@brentvatne I am using 5.0.3

this appears to be an issue that many people have run into with npm, see the issues on the npm repo: https://github.com/npm/npm/issues/16416

I recommend installing either yarn or the latest version of npm before 5 (npm5 is currently too buggy) -- so 4.6.1 as the time of writing this is probably the best npm version to use. yarn is great too though

@rishikahpowany - npm 5 is not supported, it is very buggy, it's in the project README and you should get a warning too if you use it

@brentvatne I tried updating npm. But it failed. I get a long list of error! Is there any other way?

@rishikahpowany - I have no idea without seeing the errors. npm 5 again is very broken currently and in my opinion should not be installed by default because of that. I recommend using yarn instead, it is a npm replacement. See: https://yarnpkg.com/en/docs/install

Same Problem
npm version - v4.6.1
node version - v6.10.0
I have tried yarn also still got errors and I also tried npm cache clean command.
still got the same error

Could you explain how you installed react-native? I recommend remove and re-install react-native again.

Same issue. I am having npm version 3.101.0 and node version 6.11.0

@kanak-infoObjects - please read the full thread, this appears to be a bug in old versions of npm, try updating to npm 4 or just use yarn, which is a replacement for npm and works better generally: https://yarnpkg.com/en/docs/install

@mminjiaa I didn't installed react-native instead I used npm install -g create-react-native-app

@DevPrasan1 - what npm registry are you using? what version of windows?

same problem with npm v 4.6.1 and node v 6.11.0

Sorry folks I don't really know anything about troubleshooting npm issues like this on Windows. I'd recommend going through the issues reported for this on the npm repository and see if any of the suggested solutions help you: https://github.com/npm/npm/issues?utf8=%E2%9C%93&q=shasum%20check%20failed

using mac os sierra npm v 4.6.1 and still have this problem even using yarn

@brentvatne i am using windows 10

Similar issue, but I am facing this issue after I install create-react-native-app , Previously it was fine when I was using react-native-cli

  1. install npm 4.6.1 or yarn 0.24.5
  2. run npm cache clean or yarn cache clean
  3. install create-react-native-app globally
  4. run create-react-native-app some-project-name

let me know if you still have this error. anyone who replies and does not clearly say "i tried the 4 steps" and indicate whether it was yarn or npm or both, then i will delete your comment, sorry.

After following the above steps.. I got this error in cmd, But server was running and QR code was also generated

jest-haste-map: @providesModule naming collision:
Duplicate module name: bser
Paths: E:\ReactNative\EXPO\Template\node_modules\react-native\node_modules\fb-watchman\node_modules\bser\package.json collides with E:\ReactNative\EXPO\Template\node_modules\react-native\node_modules\bser\package.json

This warning is caused by a @providesModule declaration with the same name across two different files.
ERROR STARTING PACKAGER

jest-haste-map: @providesModule naming collision:
Duplicate module name: fb-watchman
Paths: E:\ReactNative\EXPO\Template\node_modules\react-native\node_modules\jest-haste-map\node_modules\sane\node_modules\fb-watchman\package.json collides with E:\ReactNative\EXPO\Template\node_modules\react-native\node_modules\fb-watchman\package.json

This warning is caused by a @providesModule declaration with the same name across two different files.

@brentvatne Thanks! Above steps worked for me fine :)

install npm 4.6.1 or yarn 0.24.5
run npm cache clean or yarn cache clean
install create-react-native-app globally
run create-react-native-app some-project-name

I got the same problem for "npm install -g create-react-native-app".I just gave access permission to command by sudo.So I write command like :- "sudo npm install -g create-react-native-app".It works for me.

I am getting this issue on ubuntu 16.04.
This is the whole process happned on installling project.

`naveen@naveen-HP-Pavilion-g6-Notebook-PC:/var/www$ sudo create-react-native-app AwesomeProject
Creating a new React Native app in /var/www/AwesomeProject.

Installing packages. This might take a couple minutes.
Installing react-native-scripts...

npm WARN deprecated @exponent/[email protected]: Please switch to @expo/spawn-async, the new name of this package. It's the same code with our new name.
npm ERR! Linux 4.8.0-56-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save-dev" "--save-exact" "react-native-scripts"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0

npm ERR! shasum check failed for /tmp/npm-3396-bb3fdd34/registry.npmjs.org/_40exponent/ngrok/-/ngrok-2.2.7.tgz
npm ERR! Expected: 37fe66f922b1003da2a78c66b7d4d3bc9313e423
npm ERR! Actual: cd32c3d658b96974cc79b4ec248618cde6fb82ed
npm ERR! From: https://registry.npmjs.org/@exponent/ngrok/-/ngrok-2.2.7.tgz
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /home/naveen/.npm/_logs/2017-06-28T14_35_02_362Z-debug.log
npm install --save-dev --save-exact react-native-scripts failed
`

after 4 steps , and also error, the yarn version is v0.27.5
but when i uninstall yarn and run create-react-native-app react-native-app, It install success.
I think the problem is about yarn, hope helps

I had this problem when connecting to the Internet using a slow 2G mobile Internet. Having connected to the network through a 3G modem, everything was installed without problems.

hello! this should be much better now, we removed some heavy dependencies :)

try using react-native init instead of using create-react-native-app

I have tried the four steps, but it wont work.
npm version 4.6.1
node version 6.11.2
ubuntu 16.04.2
without yarn

Here's the stack trace:

See https://git.io/v5vcn for more information, either install watchman or run the following snippet:
sudo sysctl -w fs.inotify.max_user_instances=1024
sudo sysctl -w fs.inotify.max_user_watches=12288
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: react-native-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/bugs/.npm/_logs/2017-08-26T15_01_48_747Z-debug.log

Try npm clean cache --force

On Aug 26, 2017 11:09 PM, "Abed Kibbe" notifications@github.com wrote:

I have tried the four steps, but it wont work.
npm version 4.6.1
node version 6.11.2
ubuntu 16.04.2
without yarn

Here's the stack trace:

See https://git.io/v5vcn for more information, either install watchman or
run the following snippet:
sudo sysctl -w fs.inotify.max_user_instances=1024
sudo sysctl -w fs.inotify.max_user_watches=12288
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: react-native-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/bugs/.npm/_logs/2017-08-26T15_01_48_747Z-debug.log

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/react-community/create-react-native-app/issues/229#issuecomment-325136493,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AUKE_9fJrkZIWe-3SWI823Adkxn6Vj68ks5scDUzgaJpZM4NnZTJ
.

I uninstalled create-react-native-app with sudo npm uninstall -g create-react-native-app
executed sudo npm clean cache --force
then re-installed again.
Still wont work :/

Try creating a project using another command: react-native init

On Aug 27, 2017 3:50 PM, "Abed Kibbe" notifications@github.com wrote:

I uninstalled create-react-native-app with sudo npm uninstall -g
create-react-native-app
executed sudo npm clean cache --force
then re-installed again.
Still wont work :/

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/react-community/create-react-native-app/issues/229#issuecomment-325182905,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AUKE_54rq8wVKLKWEr2NBL9ixTCntAjdks5scR_XgaJpZM4NnZTJ
.

Thanks for your help. It works now.

I installed watchman
executed touch .watchmanconfig and git init
then executed
sudo sysctl -w fs.inotify.max_user_instances=1024
sudo sysctl -w fs.inotify.max_user_watches=12288

See this new issue: https://github.com/react-community/create-react-native-app/issues/382

Hi, on mac I had to put the following:
sudo sysctl -w kern.maxfiles=5242880
sudo sysctl -w kern.maxfilesperproc=524288
Then it worked!

I hope it cannot dommage anything (new values are pretty high)...

Thanks a lot! @yogur solution worked for me

  • I installed watchman
  • executed touch .watchmanconfig and git init (sounds weird but is a must)
  • then execute
sudo sysctl -w fs.inotify.max_user_instances=1024
sudo sysctl -w fs.inotify.max_user_watches=12288

In my particular case i used __122288__, since you have installed watchman the system tells you if this number is enought or have to be greater.

try running npm set registry https://registry.npmjs.org/ it worked for me

@abhitej60 that's kind of a major security vulnerability, essentially downloading all packages without the session security afforded with https.

July 2018 - Node 10.6 with npm 6.1 - still getting same error on Windows. Takes too long to fail. I will try to downgrade to npm 4 but so it is not looking promising.

why do i have these errs
npm set registry https://registry.npmjs.org/
module.js:549
throw err;
^

Error: Cannot find module '../lib/utils/unsupported.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:19:21
at Object. (/usr/local/lib/node_modules/npm/bin/npm-cli.js:145:3)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)

I did the 4 steps and it will create the project but as an empty project with empty package.json.
I also tried react-native init and i get the same error.
heres what i see in the console..
CONSOLE BELOW:
computer/kev:react-native pwntastic$ create-react-native-app AwesomeProject

Creating a new React Native app in /Users/kev/Documents/react-native/AwesomeProject.

Using package manager as yarnpkg with yarn interface.
Installing packages. This might take a couple minutes.
Installing react-native-scripts...
yarn add v1.7.0
error An unexpected error occurred: "EACCES: permission denied, scandir '/Users/pwntastic/.config/yarn/link'".

~EDIT~
I used:

sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config

and this fixed it for me. source: https://stackoverflow.com/questions/49529696/yarn-error-eaccess-permission-denied-scandir-home-ubuntu-config-yarn-link

It's an npm problem the version that you are using is probably not stable downgrade to a 4.6.1 version using :
npm install -g npm@version

this project has been replaced by expo-cli, see the README: https://github.com/react-community/create-react-native-app#quick-overview

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tonyhb picture tonyhb  Â·  5Comments

iRoachie picture iRoachie  Â·  5Comments

witbybit picture witbybit  Â·  4Comments

scf4 picture scf4  Â·  5Comments

JackWReid picture JackWReid  Â·  4Comments