react-native init stuck

Created on 16 Sep 2016  路  16Comments  路  Source: facebook/react-native

When i make a project with

react-native init AwesomeProject --verbose

i have this message:

npm WARN [email protected] requires a peer of react@~15.3.1 but none was installed.
npm verb exit [ 0, true ]
npm info ok

and then the process hangs there forever

in my project folder i have npm_modules folder and the file package.json like this:

{
  "name": "AwesomeProject",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start"
  },
  "dependencies": {
    "react-native": "0.33.0"
  }
}

if i try to

react-native run-ios

the process hangs from the beginning and writes nothing as output, not even an error

i'm on macOS
react-native 0.33

Locked

Most helpful comment

I found the react-native script will run watchman sometimes. When I run
watchman version
It would hang.

After re-install watchman, everything is ok.
rm -rf /usr/local/var/run/watchman/ && brew uninstall watchman && brew install watchman

All 16 comments

I have a similar issue, though mine bails out with:

npm WARN [email protected] requires a peer of react@~15.3.1 but none was installed.
npm verb exit [ 0, true ]
npm info ok 
Setting up new React Native app in /Users/patrick/pigmik/PikanikMobile
module.js:442
    throw err;
    ^

Error: Cannot find module 'glob-base'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/patrick/pigmik/PikanikMobile/node_modules/parse-glob/index.js:11:16)
    at Module._compile (module.js:541:32)
    at Module._extensions..js (module.js:550:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/patrick/pigmik/PikanikMobile/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)

I'm on El Capitan 10.11.6, and have tried with node 4.2.1, 6.3.1, and 6.6.0 with and without nodenv. Each time yields the same results.

frustrated

I'm on El Capitan 10.11.6 too
Node 6.6.0
This is a nightmare, i don't know what to do on monday... is there a way to reinstall the OS without loosing all the apps and data?

I got the similar issue.

react-native-cli: 1.0.0
react-native: 0.33.0
El Capitan 10.11.6

I don't know what's the reason because everything was ok on yesterday. And I found Imust run the script with root privilege, such as

sudo react-native init AwesomeProject
sudo react-native start
sudo react-native run-android

BTW, I installed the Security Update 2016-001 for El Capitan a few days ago and restart my MBP this morning.

So, I was able to resolve things by blowing away my ~/.npm folder. Tested and succeeded on node 4.4.3 and 6.6.0.

joy

Same issue on osx 10.11.6, rn 0.33.0.

Reboot after Security Update 2016-001 installed.

Above rm -rf ~/.npm does not work for me.

Can start old project and init new project IF running as root. Cannot start old project or init new project running as user.

rm -rf ~/.npm does not work for me neither.. this begins to be frustrating..

+1 same issue here as OP. Using latest version of react-native-cli
node: 6.6.0
macOS: 10.11.6

+1 same issue for the past few days
node: 6.6.0
maxOS: 10.11.6

As I wrote in another issue, the same problem, It started to happend after I run the run android

I could not create any new project since then. I tried different node version and npm versions but still nothing.

And there is no errour output.

[email protected] requires a peer of react@~15.3.1 but none was installed.
npm verb exit [ 0, true ]
npm info ok``

for me it started when i updated xcode to v. 8.. now i downgraded it but still nothing works.
It seems we cannot find a common ground for this thing :(

I found the react-native script will run watchman sometimes. When I run
watchman version
It would hang.

After re-install watchman, everything is ok.
rm -rf /usr/local/var/run/watchman/ && brew uninstall watchman && brew install watchman

After re-install watchman, everything is ok.
rm -rf /usr/local/var/run/watchman/ && brew uninstall watchman && brew install watchman

@feisan, this works for me, thanks.

Actually yes!! Watchman is the issue. It works like a charm now. @feisan @sun2rise

@feisan you really changed my monday morning!! thank you, it works!!!

@feisan Thanks. Worked like a charm.

+1 @feisan fixed it for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anchetaWern picture anchetaWern  路  3Comments

DreySkee picture DreySkee  路  3Comments

josev55 picture josev55  路  3Comments

phongyewtong picture phongyewtong  路  3Comments

axelg12 picture axelg12  路  3Comments