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

Packager isn't working for my hello world #349

Closed
Mazuh opened this issue Aug 6, 2017 · 17 comments
Closed

Packager isn't working for my hello world #349

Mazuh opened this issue Aug 6, 2017 · 17 comments

Comments

@Mazuh
Copy link

Mazuh commented Aug 6, 2017

Description

I'm trying to start a new app following the readme steps. But npm start is taking too long.

I never used npm before, just saying. My guess it's some dependence is missing, I even tried npm install -g react with no success (npm start keeps taking too long). I'm lost here.

Expected Behavior

Since it's the very first time I'm trying to run this, I don't really know what should be happening here.

Observed Behavior

npm start

InfoBusUFRN-App@0.1.0 start /home/mazuh/Projects/InfoBusUFRN-App
react-native-scripts start
6:00:04 PM: Starting packager...
6:42:37 PM: Stopping packager...
6:42:37 PM: Packager stopped.

Environment

Please run these commands in the project folder and fill in their results:

  • npm ls react-native-scripts:
    InfoBusUFRN-App@0.1.0 /home/mazuh/Projects/InfoBusUFRN-App
    └── react-native-scripts@1.1.0

  • npm ls react-native:
    InfoBusUFRN-App@0.1.0 /home/mazuh/Projects/InfoBusUFRN-App
    └── react-native@0.46.4

  • npm ls expo:
    └─┬ expo@19.0.1
    └── UNMET PEER DEPENDENCY react@>=15.3.1

npm ERR! peer dep missing: react@>=15.3.1, required by lottie-react-native@1.1.1
npm ERR! peer dep missing: react@>=15.4.0, required by react-native-branch@2.0.0-beta.3

  • node -v:
    v6.11.2

  • npm -v:
    3.10.10

  • yarn --version:
    Not installed.

  • watchman version:
    Not found.

  1. Operating system: Ubuntu 17
  2. Phone/emulator/simulator & version: Android 6
@brentvatne
Copy link
Member

hello! can you try installing watchman? https://facebook.github.io/watchman/

basically just install it then try running npm start again

@Mazuh
Copy link
Author

Mazuh commented Aug 6, 2017

Tried npm install -g watchman and then npm start wasn't doing anything again. It keeps "starting packager".

Following Stackoverflow tips, I removed node_modules directory and tried npm install. And here's what happened:

$ npm install

npm WARN lottie-react-native@1.1.1 requires a peer of react@>=15.3.1 but none was installed.
npm WARN react-native-branch@2.0.0-beta.3 requires a peer of react@>=15.4.0 but none was installed.
up to date in 9.026s

$ npm install react@>=15.4.0

npm WARN lottie-react-native@1.1.1 requires a peer of react@>=15.3.1 but none was installed.
npm WARN react-native-branch@2.0.0-beta.3 requires a peer of react@>=15.4.0 but none was installed.

I'm really having no idea of what to do. I just want to create my "hello world".

Anyway, my package json shows:

  "dependencies": {
    "expo": "^19.0.0",
    "react": "^16.0.0-alpha.12",
    "react-native": "^0.46.1"
  }

@Mazuh Mazuh changed the title Npm start isn't working for my hello world Packager isn't working for my hello world Aug 7, 2017
@Mazuh
Copy link
Author

Mazuh commented Aug 7, 2017

Tried yarn too. No success either.

Since I have been the whole day trying this "quick method", I'll go for Visual Studio and/or pure react-native see if I can get better results.

@shivatalwar
Copy link

I have the exact same issue. Prop-types and createClass were deprecated on the newest version of react. I believe there are some libraries in react-native that still use these.

@tomekwalas
Copy link

Hey I had the same problem and this helped me:
echo fs.inotify.max_user_instances=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
echo fs.inotify.max_queued_events=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

@Mazuh
Copy link
Author

Mazuh commented Aug 8, 2017

I indeed got better results trying the "react-native-cli" method. That said, I won't try @Brejw15 suggestion, but I still would like to know what these command lines are doing (and why).

Won't close the issue either, since it seems to be a bug.

@Mazuh
Copy link
Author

Mazuh commented Aug 8, 2017

I don't know if it's somehow related to this:

facebook/react-native#3199

But just saying, I'm not getting any errors at all. It just gets stuck at "starting packager" forever.

@limichange
Copy link

limichange commented Aug 11, 2017

$ npm start --verbose
npm info it worked if it ends with ok
npm verb cli [ '/Users/limichange/.nvm/versions/node/v8.3.0/bin/node',
npm verb cli   '/Users/limichange/.nvm/versions/node/v8.3.0/bin/npm',
npm verb cli   'start',
npm verb cli   '--verbose' ]
npm info using npm@5.3.0
npm info using node@v8.3.0
npm verb run-script [ 'prestart', 'start', 'poststart' ]
npm info lifecycle rn-test2@0.1.0~prestart: rn-test2@0.1.0
npm info lifecycle rn-test2@0.1.0~start: rn-test2@0.1.0

> rn-test2@0.1.0 start /Users/limi/testCode/rn-test2
> react-native-scripts start

06:29:51: Starting packager...

me too.

@baptistemanson
Copy link

I'm not an expert, but what do you see when you type:

$ DEBUG=* npm start

?

@limichange
Copy link

@baptistemanson


$ DEBUG=* npm start

> rn-test2@0.1.0 start /Users/limichange/testCode/rn-test2
> react-native-scripts start

06:56:57: Starting packager...
  express:application set "x-powered-by" to true +0ms
  express:application set "etag" to 'weak' +5ms
  express:application set "etag fn" to [Function: wetag] +0ms
  express:application set "env" to 'development' +1ms
  express:application set "query parser" to 'extended' +0ms
  express:application set "query parser fn" to [Function: parseExtendedQueryString] +0ms
  express:application set "subdomain offset" to 2 +0ms
  express:application set "trust proxy" to false +1ms
  express:application set "trust proxy fn" to [Function: trustNone] +0ms
  express:application booting in development mode +0ms
  express:application set "view" to [Function: View] +0ms
  express:application set "views" to '/Users/limi/testCode/rn-test2/views' +1ms
  express:application set "jsonp callback name" to 'callback' +0ms
  express:router use '/' query +17ms
  express:router:layer new '/' +0ms
  express:router use '/' expressInit +1ms
  express:router:layer new '/' +0ms
  express:router use '/' jsonParser +0ms
  express:router:layer new '/' +0ms
  express:router use '/' urlencodedParser +4ms
  express:router:layer new '/' +0ms
{ name: 'expo',
  hostname: 'limis-MacBook-Air-2.local',
  pid: 6677,
  type: 'project',
  project: '/Users/limichange/testCode/rn-test2',
  level: 40,
  tag: 'expo',
  msg: 'Warning: You are using npm version 5.3.0. There may be bugs in this version, use it at your own risk. We recommend version 4.6.1.',
  time: 2017-08-11T22:56:58.810Z,
  v: 0 }

@baptistemanson
Copy link

Have you tried a lower version of node (LTS version 6.x) and yarn instead of npm?
I personally use nvm to switch the node version I use with ease, and have installed yarn with the curl command.

@limichange
Copy link

@baptistemanson Thank you so much. I have solved it. It's a network problem.
#343 (comment)

@Mazuh
Copy link
Author

Mazuh commented Aug 12, 2017

I did tried two different networks and yarn With no success.

@baptistemanson
Copy link

Sorry! I want to cheer you up. Must be not fun.
Again I'm not an expert in Expo, just trying to help you. Hang on, there is still tons of hope for your project.
Do you see your express server starting when launching with:

$ DEBUG=* npm start

You can copy the trace and I'll dig in your logs.

@vs1682
Copy link
Contributor

vs1682 commented Aug 12, 2017

@Mazuh you should try @Brejw15's solution. You can refer to #234.
Those command tells if the system is capable of tracking your files for any changes.
Watchman need those commands.
Also refer https://facebook.github.io/watchman/docs/install.html#system-specific-preparation

@limichange
Copy link

you can try this. turn off your wifi, and run it.

@anp
Copy link
Contributor

anp commented Oct 17, 2017

@Mazuh I don't think you installed watchman correctly, npm i -g watchman won't get you an up to date version. Can you try installing from the https://facebook.github.io/watchman docs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants