Ishan Patel
Ishan Patel

Reputation: 6091

nodenv: version `8.9.1' is not installed

I am trying to run my React project by npm start but get following error.

nodenv: version `8.9.1' is not installed 
(set by /Users/xyz/github-repos/react/.node-version)

Upvotes: 1

Views: 8981

Answers (3)

Sabrina Leggett
Sabrina Leggett

Reputation: 9495

on mac I had to first do

brew upgrade nodenv node-build

then I could do

nodenv install 8.9.1
nodenv local 8.9.1

Upvotes: 4

Webdevotion
Webdevotion

Reputation: 1243

A oneliner solution might be:

nodenv install $(cat .node-version)
  • print the version specified in .node-version
  • use that as input for the nodenv install command

If your environment is setup correctly, there is no need to redefine the local version with nodenv local. The version is already saved in the aforementioned .node-version file.

You would run nodenv local <version> on the first system where you define the project's nodejs version to write the preferred nodejs version to .node-version.

Running yarn or yarn install is not part of the requirements to run the correct nodejs version in the project's directory. Running yarn will install the dependencies specified in package.json.

Upvotes: 13

Ishan Patel
Ishan Patel

Reputation: 6091

Following commands fixed my problem

nodenv install 8.9.1
nodenv local 8.9.1
yarn install

Upvotes: 0

Related Questions