Node wont update, despite downloading and installing latest versions - node.js

I am trying to create a new React app with create-react-app. However, when I ran npx create-react-app my-app I got an error:
npx: installed 67 in 8.408s You are running Node 12.22.0.
No worries, I went to the node.js site and downloaded and installed the latest version (18.1.0) and tried again, but got the same error.
Running node -v says I'm still using 12.22.-0.
So I tried npm install -g node --force. Install went fine, but again running node -v still says I'm using 12.22.0 and create-react-app wont work.
I am on Mac OS.
What can I do?

Node isn't installed via npm.
You need to either install Node via the official Mac OS installer, or via Brew (Recommended if you need more than one version)
https://nodejs.org/en/download/ - Download the Mac OS installer that suits your OS Version.

Related

Npm isn't getting automatically installed on installing node.js

While hosting my webapp on heroku I got a message of some bugs in my npm package, my npm package was of version 3 and node.js was of version 8, I wrote thinking that I can update my npm version I tried to update it but the version remained same so I decided to uninstall it and wrote the command "npm uninstall " and than again tried to install npm but in vain ,finally I uninstalled my node.js and reinstalled tha npm will automatically get installed with it, but this too didn't work now I have node of version 10 with no npm which I got to know by checking version of npm which gave me message of "command not found ", now my every try to install npm has failed , may anyone suggest me what I can do to restore my losses and resume my work.
I am not sure if you have Linux or Windows. First I would check if the npm folder is in path.
You can follow one of these two to add to path if it is not done yet.
Windows
Linux
Alternatively you can install node with node version manager (nvm):
nvm linux and mac
nvm windows

Create-React-App requires Node 4.0 or higher - on Windows

I installed NodeJs LTS v8.11.3 for windows.
Then in cmd I wrote npm -g install create-react-app but I gave a an error that I need Node 4 or higher.
When I run node --v, I have got 0.12.2.
I didn't find how can I change it on windows. I already tried uninstall and restart computer, clean the cache, check windows path if nodeJs is here...
After that, still the same error:
*You are running Node 0.12.2.
Create React App requires Node 4 or higher.
Please update your version of Node.*
What should I do more? Thanks for ideas.
I have moved from 0.8 to 0.10, using the .msi package, overwriting the one installed on my system. Package problems were all fixed with npm update -g. Worked like a charm.
In case it does not work like a charm:
npm cache clean usually fixes the problem. Once the cache is empty, just run npm update -g again.
Ok, I solved it by these steps:
Clean cache from cmd.
Uninstall nodeJs from Program and Features.
Remove folder nodeJs from PATH variable.
Remove nondeleted folder nodeJs from ProgramFiles (here still were some files(?!)).
Restart Computer and after that install nodeJs from website.
After instalation - Restart Computer again.
Run cmd and checked by node -version.
Thanks for your time.

Installing Ionic - The term 'ionic' is not recognized

I am having trouble installing node.js and npm on my computer. I am running Windows 10 Pro x64, and using Windows Powershell (admin).
I am running node.js 9.10.1 and npm 5.8.0
Here's a screenshot of the error:
As you can see from the screenshot, I installed ionic cordova using the npm install -g ionic cordova command. (I don't know what the difference between that and npm install -g ionic is, though.)
I tried changing the windows PATH -thing, but I'm not sure if I did it correctly. (In the path-environment-variable I added a path to 'C:\Users\Peter\AppData\Local\npm' and one to 'Z:\Program\nodejs' where I installed node.js.)
Try using Roaming instead of Local. I think that installing with -g should go in Roaming.
C:\Users\Peter\AppData\Roaming\npm>

React Native Node install Error

I am trying to install the environment for react native.
I followed the instruction of the site until the point to enter into the cmd
create-react-native-app AwesomeProject
after several moments I get a big green message:
You are currently running Node v0.12.2.
React Native runs on Node 4.0 or newer. There are several ways to
upgrade Node.js depending on your preference.
nvm: nvm install node && nvm alias default node
Homebrew: brew unlink iojs; brew install node
Installer: download the Mac .pkg from https://nodejs.org/
About Node.js: https://nodejs.org
Follow along at: https://github.com/facebook/react-native/issues/2545
I try to upgrade my nodejs but I have the newest version form the site.
why does it still throws me this error ?
Hi user24136 i build react native apps myself and i have latest Node version running. Error states your Node.js installed is old and React Native does run on Node 4.0+. Seems like your on a Mac, visit this link Node.js and use installer to upgrade your NPM and Node to latest versions. After successful installations run commands node -v and npm -v and you should see newer version v6.10.3 and 3.10.10 respectively. Then run command react-native init AwesomeProject and check if it works.
This problem interested in from your only node version
you can use sudo n stable command your terminal. This command increase your node version.

Create-React-App requires Node 4.0 or higher

I installed NodeJs LTS v6.9.5 for windows, and then did
npm -g install create-react-app
But it gave me a warning that I need node 4.0
When I run node --version, I got 0.12.2
And when I run :
create-react-app hello-world
I got the error:
"You are running Node 0.12.2
Create React App requires Node 4 or higher"
any idea how to make it work.
And why node version shows 0.12.2, when I installed NodeJs LTS v6.9.5
You have multiple versions of node installed on your machine thats why it is showing 0.12.2. Use n or nvm to change or switch node versions. (They are not supported on windows yet).

Resources