facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.23k stars 24.34k forks source link

Can't start development server by command. #878

Closed webryan closed 9 years ago

webryan commented 9 years ago

Start Development Server In root directory, we need to start React Native development server.

(JS_DIR=pwd/ReactComponent; cd Pods/React; npm run start -- --root $JS_DIR) This command will start up a React Native development server within our CocoaPods dependency to build our bundled script. The --root option indicates the root of your React Native apps – this will be our ReactComponents directory containing the single index.ios.js file. This running server will package up the index.ios.bundle file accessible via http://localhost:8081/index.ios.bundle.

I try to start development server by npm run start -- -- root $JS_DIR/npm run start --root $JS_DIR in my objective-c project, but it's not work. The npm throw a error message.

Any other way to start a development server?

ide commented 9 years ago

Any other way to start a development server?

Run packager/packager.sh, and tell it the where your app JS and images are with --root and --assetRoots respectively.

Can you also paste the npm error here?