Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm start doesn't work after upgrade to 0.15.0 #4341

Closed
Bhullnatik opened this issue Nov 25, 2015 · 17 comments
Closed

npm start doesn't work after upgrade to 0.15.0 #4341

Bhullnatik opened this issue Nov 25, 2015 · 17 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@Bhullnatik
Copy link
Contributor

npm start stopped working after upgrading to React-Native 0.15.0 yielding:

> [email protected] start Dev/tmp/AwesomeProject
> react-native start

Looks like you installed react-native globally, maybe you meant react-native-cli?
To fix the issue, run:
npm uninstall -g react-native
npm install -g react-native-cli

Output of npm -g list --depth=0:

/usr/local/lib
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

Output of npm list --depth=0:

[email protected] Dev/tmp/AwesomeProject
└── [email protected]

To be noted, using react-native start works as expected, which make me think this is a npm bug but I'm not sure on how to get started.

@facebook-github-bot
Copy link
Contributor

Hey Bhullnatik, thanks for reporting this issue!

React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.

  • If this is a feature request or a bug that you would like to be fixed by the team, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
  • If you don't know how to do something or not sure whether some behavior is expected or a bug, please ask on StackOverflow with the tag react-native or for more real time interactions, ask on Discord in the #react-native channel.
  • We welcome clear issues and PRs that are ready for in-depth discussion; thank you for your contributions!

@ahanriat
Copy link
Contributor

@radko93
Copy link
Contributor

radko93 commented Nov 25, 2015

Try adding react-native-cli to your (dev) dependencies.

@ahanriat
Copy link
Contributor

It works perfectly ! Thanks @radko93

@Bhullnatik
Copy link
Contributor Author

Thanks, this works but is it the expected behavior? Shouldn't react-native-cli be installed globally? Why the change in the 0.15.0?

@ide
Copy link
Contributor

ide commented Nov 25, 2015

npm 3 might have broken global lookup of modules from npm run-scripts (I haven't verified... just a guess)

@Bhullnatik
Copy link
Contributor Author

@ide That's what my first thought was, but under the same node/npm configuration it works with React-Native 0.14.0, while it doesn't with the 0.15.0+.
I would be interested in fixing this myself, but I don't know where to begin looking.

Thanks for your answer.

@radko93
Copy link
Contributor

radko93 commented Nov 25, 2015

It's not npm 3 case, I've tested it on npm v2 and archieved the same problem.

@grimen
Copy link

grimen commented Nov 26, 2015

Ran into the issue, resolved after plenty of head scratching by cleaning node_modules (rm -rf ./node_modules) and then upgrading NPM (npm install npm -g) and install deps in the generated React Native project (npm install). Upgrade clash I guess, didn't have this issue last week.

@exoer
Copy link

exoer commented Nov 28, 2015

@xxmyjk
Copy link

xxmyjk commented Dec 31, 2015

http://stackoverflow.com/questions/33908314/packager-wont-start, the following helps me

  "scripts": {
    "start": "$NVM_BIN/react-native start"
  }

@GantMan
Copy link
Contributor

GantMan commented Feb 22, 2016

👍 adding cli as a dependency worked for me for android deploys

@GantMan
Copy link
Contributor

GantMan commented Apr 6, 2016

Something went fishy with today's build. I had to:
npm un react-native-cli and npm i react-native-cli
FYI for others.

@muratsu
Copy link

muratsu commented Apr 21, 2016

@GantMan same thing happened to me too. Reinstalling react-native-cli once you update react-native solves the problem as you mentioned.

@madhums
Copy link

madhums commented May 17, 2016

Adding react-native-cli to dev-deps doesn't solve the issue. What is the real issue here?

"react-native": "0.19.0",
"react-native-cli": "~0.2.0"
$ node -v 
v6.1.0
$ npm -v 
3.8.6

@madhums
Copy link

madhums commented May 17, 2016

After npm install,

$ ls -l node_modules/.bin/react-native
lrwxr-xr-x  1 madhu  staff  47 May 17 15:04 node_modules/.bin/react-native -> ../react-native/local-cli/wrong-react-native.js

@madhums
Copy link

madhums commented May 17, 2016

Ah, nevermind

npm un react-native-cli -D
npm un react-native-cli -g
rm -rf node_modules
npm cache clear
npm i
npm i react-native-cli -D

and then it works. Weird !!

@facebook facebook locked as resolved and limited conversation to collaborators Jul 20, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests