Reputation: 6091
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
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
Reputation: 1243
A oneliner solution might be:
nodenv install $(cat .node-version)
.node-version
nodenv install
commandIf 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
Reputation: 6091
Following commands fixed my problem
nodenv install 8.9.1
nodenv local 8.9.1
yarn install
Upvotes: 0