Home > Software design >  Create-react-app and outdated node version
Create-react-app and outdated node version

Time:01-01

When i'm trying to create a new react app using standard create-react-app tut1 i'm getting:

You are running Node v12.18.3.
Create React App requires Node >=14.0.0 or higher.
Please update your version of Node.

I's strange because I've already updated botch npm & node using:

install npm@latest -g 

and

npm install -g node@latest

moreover when i type npm list -g node i get [email protected] BUT when i check the node version node -v i get indeed old v12.18.3, Why are there such discrepancies?

CodePudding user response:

That's not the way to install node. Use nvm on Linux and nvs on Windows.

CodePudding user response:

Node is a runtime environment that provides the NPM module. Also,

node -v

will tell you the exact version of node you are running and would have installed earlier. npm or Node package manager gets installed with it when you install node. You can get the latest version from the link below.

https://nodejs.org/en/download/

CodePudding user response:

You would have to uninstall your existing node.js version and install the latest or LTS version from https://nodejs.org/en

The correct way to check your Node version is node -v

Node.js is runtime and npm is a cli that runs on top of Node and requires that Node runtime is available.

npm is the package manager for the Node JavaScript platform. It let's you install software libraries, plugins, frameworks and applications but not Node itself.

npm comes bundled with Node, but you should be able to install an updated npm package.

It is possible to install multiple Node versions, see https://docs.npmjs.com/downloading-and-installing-node-js-and-npm for details.

CodePudding user response:

Check out NVM (node version manager). Essentially you can create a .nvmrc file that has the version of node you want for this project. Then run nvm install at the location of your project. This will set the terminal to use the node version you specified.

  • Related