Node version issue with react-native - reactjs

I'm running react-native init on osx and gets the following error:
You are currently running Node v0.10.30 but React Native requires >=4. Please use a supported version of Node.
But when running brew upgrade node it say: node 6.8.1 already installed.
Any ideas?

OK, had problems with the node installation. Finally uninstalled node by removing all related directories and running the following:
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

Related

Running into problems installing MongoDB on MacOS Terminal

I am trying to install mongoDB as a macOS service but I am running to some errors
I first put in the terminal
brew tap mongodb
Nothing really happens.
But, when I run:
brew install mongodb-community#5.0
I receive:
Warning: No available formula with the name "mongosh" (dependency of mongodb/brew/mongodb-community). Did you mean mongocli?
==> Searching for similarly named fo This similarly named formula was found: mongocli ✔
To install it, run: brew install mongocli ✔ It was migrated from mongodb/brew to homebrew/core.
Finally, when I run
brew services start mongodb-community#5.0
I receive
Error: Formula 'mongodb-community' is not installed.
Any advice?
I had the same happen, however my issue was actually with this error:
fatal: could not solve HEAD to a revision
solve it using:
git -C $(brew --repository homebrew/core) checkout master
you can also:
brew update
brew upgrade
brew upgrade --cask
brew cleanup
and then restart the mongodb community edition install process again! Worked for me!
I am experiencing the exact same problem (I am using MacOC version 11.5.1).
The reason why your brew tap mongodb does not seem to be doing anything may be because you have already tapped into mongodb. Try untapping with brew untap mongodband retapping with brew tap mongodb/brew.
After you have established the connection, try installing again with brew install mongodb-community#5.0. At this stage, I could not get the installation to work for version 5.0 so I installed version 4.4 instead (with brew install mongodb-community#4.4).
After that, try running mongo with brew services start mongodb-community#5.0 (or brew services start mongodb-community#4.4 if you have installed 4.4 version) and it should work just fine!
If you have installed version 4.4, be sure to run the command PATH="/usr/local/opt/mongodb-community#4.4/bin" mongo to start the mongo shell.
I was also having the same issue. This solved it for me:
git -C $(brew --repository homebrew/core) checkout master
brew update
brew upgrade
brew upgrade --cask
brew cleanup
Then install the latest version of Mongodb community using:
brew install mongodb-community#6.0
Note: version might be outdated at the time you're reading this
Check with brew list | grep mongo that mongodb-community, mongodb-database-tools, mongosh exist at your PC. If they do not exist, install them with brew.
Recently also installed mongodb V4.4.5 and can not start it with brew services start mongodb-community. For me works starting it manually as a background process as admin sudo mongod --config /usr/local/etc/mongod.conf --fork
And last call mongo to work with mongoDB shell.
Reason: directory/file access issue. Not sure.

nvm ls-remote N/A node doesn't get installed

I am trying to install node v8.16.1 using nvm. I installed nvm using curl -k -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
nvm --version gave me 0.35.3 as expected.
But when I did nvm install 8.16.1 I got Version '8.16.1' not found - try nvm ls-remote to browse available versions.
nvm ls-remote gave result as N/A.
I have tried the following solutions:
Adding this to ~/.bashrc export NVM_NODEJS_ORG_MIRROR=http://nodejs.org/dist
Adding this to ~/.bashrc instead of above; export NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist
Adding this to ~/.bashrc export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
sudo update-ca-certificates
But none have worked.
I have been trying for hours. Please suggest some solutions.
echo insecure >> ~/.curlrc
Above command works for me.

react-360 did not create project

I installed react-360 using npm install -g react-360-cli.
But react-360 init Hello did not create any directory.
I am using ubuntu 14.04.
Any errors you have encountered?
1) You could be having permission issues while trying to install packages in node_modules folder. Try changing the permission to the folder like:
sudo chown -R USERNAME /FILE_PATH
2) Try updating node version if 1st doesn't work.

Launch Nodejs/Angularjs app in Ubuntu

I have just read tutorial on Angularjs and wanted to run test application (by (C) Wahlin Consulting) from http://tinyurl.com/AngularJSDemos . Its readme informs that:
NODE.JS OPTION:
If you want to run the site using Node.js (install it from http://nodejs.org) run the following at the command-prompt from within the AngularJSDemos folder:
node server.js
Now navigate to http://localhost:8080/DemoList.html or http://localhost:8080/CustomerManagementApp in your browser.
I have installed nodejs and tried to launch it from terminal in my Ubuntu system:
mainuser#mylaptop:~$ cd /home/mainuser/Ebooks/AngularJS/AngularJSDemos/AngularJSDemos/
mainuser#mylaptop:~/Ebooks/AngularJS/AngularJSDemos/AngularJSDemos$ node server.js
The program 'node' can be found in the following packages:
* node
* nodejs-legacy
Try: sudo apt-get install <selected package>
mainuser#mylaptop:~/Ebooks/AngularJS/AngularJSDemos/AngularJSDemos$ sudo apt-get install node
...
mainuser#mylaptop:~/Ebooks/AngularJS/AngularJSDemos/AngularJSDemos$ node server.js
mainuser#mylaptop:~/Ebooks/AngularJS/AngularJSDemos/AngularJSDemos$ node server.js
mainuser#mylaptop:~/Ebooks/AngularJS/AngularJSDemos/AngularJSDemos$ node
mainuser#mylaptop:~/Ebooks/AngularJS/AngularJSDemos/AngularJSDemos$ node ./server.js &
[1] 11153
mainuser#mylaptop:~/Ebooks/AngularJS/AngularJSDemos/AngularJSDemos$ node ./server.js
[1]+ Exit 1 node ./server.js
mainuser#mylaptop:~/Ebooks/AngularJS/AngularJSDemos/AngularJSDemos$ node ./server.js
mainuser#mylaptop:~/Ebooks/AngularJS/AngularJSDemos/AngularJSDemos$ sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version.
The following packages were automatically installed and are no longer required:
kde-l10n-engb kde-l10n-pl linux-headers-3.13.0-32
linux-headers-3.13.0-32-generic
Use 'apt-get autoremove' to remove them.
0 to upgrade, 0 to newly install, 0 to remove and 28 not to upgrade.
mainuser#mylaptop:~/Ebooks/AngularJS/AngularJSDemos/AngularJSDemos$
But whatever I do, I cannot launch this example. In Chrome "This web page is not available" and in Firefox "Unable to connect". Moreover, it looks like I simply cannot launch it in terminal.
How to launch this example?
I'd recommend using nvm to install node and manage different version on your system.
It's quite easy:
# First, we need to clone the nvm repository:
$ git clone https://github.com/creationix/nvm.git ~/.nvm
# Then, we need to add the following line to our .profile, .bashrc or .zshrc:
$ echo "source ~/.nvm/nvm.sh" >> .zshrc
Installing nvm is not enough, we now need to install node & npm.
# To print out the list of all the available versions, simply run:
$ nvm ls-remote
# We want to install the current stable version which is v0.10.26, so we need to run:
The -s flag means we want to compile node from source.
$ nvm install -s v0.10.30
When the installation process is finished, our brand new node and npm will be installed!
The great thing with nvm is that you can use a different version of node in each of your shell instances. But if you want to stick to the latest version, you can set it as default by running:
$ nvm alias default 0.10.30
Make sure everything is up and running by typing node -v && npm -v
Here's a different approach for this problem, the tutorial is suggesting using npm and it's fine. but it takes time, an internet connection and setting up.
Here's an alternative way, if you're already using Ubuntu, python should already be installed in your system. your python installation already comes with a simple HTTP server you can use to run your angular application.
in your console, type python -m SimpleHTTPServer 8080
then direct your browser to localhost:8080
and locate your angular project. then it should run properly.
You probably installed incorrect node package.
Thanks to that your node command is not equal to nodejs but invokes something totally different.
Try with
nodejs ./server.js
Install node in ubuntu using
sudo-apt-get install nodejs
sudo apt-get install npm
sudo apt-get install build-essential
and then run your server with following command
npm start

Uninstall MongoDB on Mac OS X

When I try to run mongod from the terminal, I get the following error:
2014-07-02T23:56:24.797-0700 [initandlisten] ERROR: listen(): bind() failed errno:48 Address already in use for socket: 0.0.0.0:27017
2014-07-02T23:56:24.797-0700 [initandlisten] ERROR: addr already in use
I recently realize that I have two versions of MongoDB on my Mac, and think this may be the source for the above error. (Plus, I do not need two version.) I tried Googling, but was not able to find clear directions on how I can uninstall. I have development version 2.7.0 AND 2.6.3.
Thanks so much in advance for the help!
Run the following commands to remove mongodb from the launch/startup and to uninstall it using Homebrew:
# See if mongo is in the launch/startup list
launchctl list | grep mongo
# Remove mongodb from the launch/startup
launchctl remove homebrew.mxcl.mongodb
# Kill the mongod process just in case it's running
pkill -f mongod
# Now you can safely remove mongodb using Homebrew
brew uninstall mongodb
Just double-check in /usr/local/bin/ to make sure that the mongodb commands are removed.
For uninstalling the community version, i found that the command brew uninstall mongodb-community worked for me
Nitin Jadhav version worked for me, brew uninstall mongodb kept given me Error: No such keg: /usr/local/Cellar/mongodb. I was removing a mongodb-community.
use cd /usr/local/Cellar then run ls -a and then run rm -rf mongodb-community to remove it
I would suggest navigating into your /usr/local/Cellar and run an ls -a, I had a community version of mongo installed that wasn't being picked up by the command given above. If you find any mongo versions there just rm -rf each instance
For those having this error in osx:
brew uninstall mongodb Error: No such keg: /usr/local/Cellar/mongodb
execute brew list | grep mongo
for example, it could show something like:
mongodb-community#4.2
mongodb-database-tools
mongosh
remove them with brew uninstall mongodb-community#4.2 mongodb-database-tools mongosh
Also execute launchctl remove homebrew.mxcl.mongodb as #anuvrat-tiku says in his answer.

Resources