Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

npm start doesn’t start Node server on new project #316

Closed
drwpow opened this issue Aug 28, 2017 · 7 comments
Closed

npm start doesn’t start Node server on new project #316

drwpow opened this issue Aug 28, 2017 · 7 comments

Comments

@drwpow
Copy link

drwpow commented Aug 28, 2017

--- Delete everything above this line before submitting your issue ---

Description

Bug

Expected behavior

Running npm start starts a server at localhost:8081.

Actual behavior

No server has started on localhost:8081.

Reproduction

Running through all the steps from Getting Started, I get the following warnings during the yarn install:

warning react-native > connect@2.30.2: connect 2.x series is deprecated
warning react-native > xcode > node-uuid@1.4.7: Use uuid module instead
warning react-devtools > electron > electron-download > nugget > progress-stream > through2 > xtend > object-keys@0.4.0:

From there, running npm start logs the open browser at http://localhost:8081/vr/ to the console, but it never starts the server (lsof -n -i4TCP:8081 comes up nil—the port isn’t in use).

The console just hangs after printing that to the console. I tried manually calling node node_modules/react-native/local-cli/cli.js start, but that does the same thing—it just hangs with no error output.

Solution

There’s probably some missing install instructions (I’ve never used React Native before, so assume I haven’t done any set up for that), or there is an error deep within an NPM package (React Native?) that’s not bubbling up to my console. I’d love to troubleshoot, but I can’t go down the node_modules rabbit hole if the point of react-vr-cli was to abstract all of this out of my control.

Additional Information

  • 'react-vr' package version: 1.4.0
  • 'react-vr-web' package version: 1.4.0
  • Node version: 8.4.0
  • Yarn version: 0.27.5
  • Operating System: MacOS Sierra
  • Graphics Card: ✨ Intel HD Graphics 4000 1536 MB✨
  • Browser: N/A
  • VR Device: N/A
@andrewimm
Copy link
Contributor

Can you copy everything that gets printed out when you run npm start?

Also, just try completely deleting the node_modules directory in your project and re-running npm install or yarn. There are no known issues at this time with any of the versions you printed above, so I can't provide much help without more info.

@drwpow
Copy link
Author

drwpow commented Aug 28, 2017

> WelcomeToVR@0.0.1 start /Users/drew/sites/WelcomeToVR
> node -e "console.log('open browser at http://localhost:8081/vr/\n\n');" && node node_modules/react-native/local-cli/cli.js start

open browser at http://localhost:8081/vr/

…that’s it. Nothing else. Still doesn’t start the server. That’s on a clean install just now.

@andrewimm
Copy link
Contributor

Do you have watchman installed? It shouldn't be necessary for everyone, but I do find that in odd cases where the server acts up, installing it tends to help.

You can learn more here: http://facebook.github.io/react-native/docs/getting-started.html#node-watchman

@drwpow
Copy link
Author

drwpow commented Aug 28, 2017

Ooh! Good suggestion. I got something:

 ┌────────────────────────────────────────────────────────────────────────────┐
 │  Running packager on port 8081.                                            │
 │                                                                            │
 │  Keep this packager running while developing on any JS projects. Feel      │
 │  free to close this tab and run your own packager instance if you          │
 │  prefer.                                                                   │
 │                                                                            │
 │  https://github.com/facebook/react-native                                  │
 │                                                                            │
 └────────────────────────────────────────────────────────────────────────────┘
Looking for JS files in
   /Users/drew/sites/WelcomeToVR

Loading dependency graph...
React packager ready.

ERROR: Unknown option --no-pretty

Watchman:  watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= ERROR: Unknown option --no-pretty

jest-haste-map: Watchman crawl failed. Retrying once with node crawler.
  Usually this happens when watchman isn't running. Create an empty `.watchmanconfig` file in your project's root folder or initialize a git or hg repository in your project.
  Error: watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= ERROR: Unknown option --no-pretty

jest-haste-map: @providesModule naming collision:
  Duplicate module name: View
  Paths: /Users/drew/sites/WelcomeToVR/node_modules/react-vr/Libraries/Components/View/View.vr.js collides with /Users/drew/sites/WelcomeToVR/node_modules/react-native/Libraries/Components/View/View.js

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: LayoutPropTypes
  Paths: /Users/drew/sites/WelcomeToVR/node_modules/react-vr/Libraries/StyleSheet/LayoutPropTypes.vr.js collides with /Users/drew/sites/WelcomeToVR/node_modules/react-native/Libraries/StyleSheet/LayoutPropTypes.js

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: NetworkOverlay
  Paths: /Users/drew/sites/WelcomeToVR/node_modules/react-vr/Libraries/VRReactOverrides/NetworkOverlay.vr.js collides with /Users/drew/sites/WelcomeToVR/node_modules/react-native/Libraries/Inspector/NetworkOverlay.js

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: AnimatedImplementation
  Paths: /Users/drew/sites/WelcomeToVR/node_modules/react-vr/Libraries/VRReactOverrides/AnimatedImplementation.vr.js collides with /Users/drew/sites/WelcomeToVR/node_modules/react-native/Libraries/Animated/src/AnimatedImplementation.js

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: NavigationExperimental
  Paths: /Users/drew/sites/WelcomeToVR/node_modules/react-vr/Libraries/VRReactOverrides/PlatformSpecific/NavigationExperimental.vr.js collides with /Users/drew/sites/WelcomeToVR/node_modules/react-native/Libraries/NavigationExperimental/NavigationExperimental.js

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: setupDevtools
  Paths: /Users/drew/sites/WelcomeToVR/node_modules/react-vr/Libraries/VRReactOverrides/setupDevtools.vr.js collides with /Users/drew/sites/WelcomeToVR/node_modules/react-native/Libraries/Core/Devtools/setupDevtools.js

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: processTransform
  Paths: /Users/drew/sites/WelcomeToVR/node_modules/react-vr/Libraries/VRReactOverrides/processTransform.vr.js collides with /Users/drew/sites/WelcomeToVR/node_modules/react-native/Libraries/StyleSheet/processTransform.js

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: Text
  Paths: /Users/drew/sites/WelcomeToVR/node_modules/react-vr/Libraries/VRReactOverrides/Text.vr.js collides with /Users/drew/sites/WelcomeToVR/node_modules/react-native/Libraries/Text/Text.js

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: ReactNativeViewAttributes
  Paths: /Users/drew/sites/WelcomeToVR/node_modules/react-vr/Libraries/VRReactOverrides/ReactNativeViewAttributes.vr.js collides with /Users/drew/sites/WelcomeToVR/node_modules/react-native/Libraries/Components/View/ReactNativeViewAttributes.js

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: YellowBox
  Paths: /Users/drew/sites/WelcomeToVR/node_modules/react-vr/Libraries/VRReactOverrides/YellowBox.vr.js collides with /Users/drew/sites/WelcomeToVR/node_modules/react-native/Libraries/ReactNative/YellowBox.js

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: TransformPropTypes
  Paths: /Users/drew/sites/WelcomeToVR/node_modules/react-vr/Libraries/VRReactOverrides/TransformPropTypes.vr.js collides with /Users/drew/sites/WelcomeToVR/node_modules/react-native/Libraries/StyleSheet/TransformPropTypes.js

This warning is caused by a @providesModule declaration with the same name across two different files.
ERROR: Unknown option --no-pretty

Watchman:  watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= ERROR: Unknown option --no-pretty

 ERROR  watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= ERROR: Unknown option --no-pretty

Error: watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= ERROR: Unknown option --no-pretty

    at ChildProcess.<anonymous> (/Users/drew/sites/WelcomeToVR/node_modules/fb-watchman/index.js:198:18)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:927:16)
    at Socket.stream.socket.on (internal/child_process.js:348:11)
    at emitOne (events.js:115:13)
    at Socket.emit (events.js:210:7)
    at Pipe._handle.close [as _onclose] (net.js:545:12)

See http://facebook.github.io/react-native/docs/troubleshooting.html
for common problems and solutions.
npm ERR! code ELIFECYCLE
npm ERR! errno 11
npm ERR! WelcomeToVR@0.0.1 start: `node -e "console.log('open browser at http://localhost:8081/vr/\n\n');" && node node_modules/react-native/local-cli/cli.js start`
npm ERR! Exit status 11
npm ERR!
npm ERR! Failed at the WelcomeToVR@0.0.1 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!     /Users/drew/.npm/_logs/2017-08-28T19_21_57_788Z-debug.log

@breadadams
Copy link

breadadams commented Aug 28, 2017

I've ran into this on RN in the past (the watchman errors in your latest comment), there's an issue with a fix, hope it helps!

@drwpow
Copy link
Author

drwpow commented Aug 28, 2017

@breadadams That worked, thanks!

My issue was a corrupted or old watchman (not sure which) installed on my machine with Homebrew I must have forgotten about. Uninstalling watchman completely seems to have fixed this issue for me:

brew uninstall watchman
npm r -g watchman

Conversely, re-installing watchman (4.9.0) seems to be OK, too. The strange part for me was it wasn’t being vocal.

@drwpow
Copy link
Author

drwpow commented Aug 28, 2017

To get that output above, I installed watchman with npm i -g watchman. That must have triggered the conflicting watchman bug from that RN issue @breadadams referenced. But again, whatever watchman version I had installed with Homebrew (I didn’t catch what version it was when it uninstalled) was silently failing.

I believe the issue is fixed.

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

No branches or pull requests

4 participants