1

I just started on a fresh dev environment with Xcode 7.2.1, and installed react-native (0.20.0). I initialized a test project to see if it would run, and I got the following error:

~/dev/TestProj/node_modules/react-native/packager ~ packager.sh: line 11: node: command not found

The iOS Simulator screen says:

Could not connect to development server.

Ensure the following: - Node server is running and available on the same network - run 'npm start' from react-native root - Node server URL is correctly set in AppDelegate

URL: http://localhost:8081/index.ios.bundle?platform=ios&dev=true

Sure enough, if I go into the project folder in a terminal window and run 'npm start' from there, the packager starts and everything works. In my experience the packager should run by itself though when you run a project with React Native. Am I doing something wrong here or is there an issue? Never had this happen with previous versions of RN.

Pedram
  • 7,479
  • 6
  • 25
  • 25
  • What are your versions of Node and NPM ? – G. Hamaide Feb 17 '16 at 13:09
  • node 5.6.0 and npm 3.7.2 – Pedram Feb 17 '16 at 23:30
  • Your error says that node is not installed, or at least not found. The command `node -v` returns v5.6.0 ? – G. Hamaide Feb 18 '16 at 10:27
  • Yes, it returned that. I think it's because I moved on to trying to get my old project working, and while trying to use npm to add new packages, I added the following to my .profile. I'm guessing this fixed it: export NPM_DIR="$HOME/.npm" [ -s "$NPM_DIR/npm.sh" ] && . "$NPM_DIR/npm.sh" – Pedram Feb 18 '16 at 22:51

1 Answers1

0

I moved on to trying to get my old project working, and while trying to use npm to add new packages, I added the following to my ~/.profile. I'm guessing this fixed it:

export NPM_DIR="$HOME/.npm" [ -s "$NPM_DIR/npm.sh" ] && . "$NPM_DIR/npm.sh"
Pedram
  • 7,479
  • 6
  • 25
  • 25