installing react native - Command line interface (env: node: No such file or directory) - react-native

While executing this command on terminal(Mac OS) for setup react native environment
:~ npm install -g react-native-cli
getting error env: node: No such file or directory

It seems you don't have node installed on your system. Follow the instructions on this link
for MacOS
Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install Node
brew install node
Install watchman
brew install watchman
Finally install React Native CLI
npm install -g react-native-cli

If you are using ubuntu try the command as
sudo npm install -g react-native-cli
and make sure node and nstrong textpm was installed in your system.

Related

Why am I unable to install expo cli?

I have followed the documentation from Expo website, installed NodeJs, git, watachmann, however I m still getting errors when installing Expo cli:
First, ensure you use the recommended version of nodejs. For that, you can use the n module:
// if you haven't installed it before
sudo npm install n -g
//to have the latest stable version
sudo n stable
Then delete all your preview installs with npm and start over. For expo-cli:
sudo npm uninstall --global expo-cli
sudo npm install --global expo-cli

react-native -bash: react-native: command not found

I Install node and Watchman
brew install node
brew install watchman
then Install React Native CLI
npm install -g react-native-cli
but when I use react-native init test
I have error:
-bash: react-native: command not found
try: sudo npm install -g react-native-cli
or npx before react native as: npx react-native init demo
first
sudo npm install -g react-native-cli
this command output path like this
/usr/local/bin/react-native -> /usr/local/lib/node_modules/react-native-cli/index.js
then(for above path example)
export PATH="/usr/local/lib/node_modules/react-native-cli/index.js"
react-native init appName

Unable to link react-native-version-number

I am trying to install react-native-version-number. The instructions state that after installing, issue;
react-native link react-native-version-number
but when I do this, I get the following error message;
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
but when I run
npm uninstall -g react-native
I get
npm WARN uninstall not installed in /usr/local/lib/node_modules: "react-native"
How do I link react-native-version-number?
As a workaround, dv3's comment about using rnpm link did work. However, I found that I was having this problem with other react-native commands, such as react-native run-android. This appears to be because npm was installed using homebrew. A description of this problem and how to fix it can be found at on this gist. In summary the required fix is to uninstall all your npm globably installed packages, uninstall node, then reinstall node, and reinstall npm without brew.
npm list -g --depth=0 # to list all your globally installed packages
rm -rf /usr/local/lib/node_modules
brew uninstall node
brew install node --without-npm
echo prefix=~/.npm-packages >> ~/.npmrc
curl -L https://www.npmjs.com/install.sh | sh
and then, you have to reinstall all your npm packages that were installed globally.

How to remove ripple emulator using npm

Have problem with uninstaling ripple emulator at Debian Jessie.
Was instaled by command
sudo npm install -g ripple-emulator
But when I try to uninstall using command
sudo npm rm ripple-emulator
It gives warning
npm WARN uninstall not installed in /home/user/node_modules: "ripple-emulator"
I have change location to /usr/share/npm/node_modules/ but there no folder with ripple emulator
If installed with the -g flag you need to pass that in when uninstalling as well. So the following should work:
sudo npm rm -g ripple-emulator

Could not install appium using ' npm install -g appium ' command

I have installed node on mavericks using 'brew install node'. Node is installed. But npm version is not shown.
$ node -v
v0.10.26
$ npm -v
-bash: npm: command not found
$ npm install -g appium
-bash: npm: command not found
Please help.
Please try re installing node from the installer package available at http://nodejs.org/
If does not work
try running sudo chmod 777 /usr/local/lib/ from Terminal and reinstall node.js