I get this error when I try to do git commit. Based on the previous issues on this I have updated the lint-staged , husky to latest version and still stuck with this.
I have uninstalled my node and now I only have node v11.14.0 and my default node also 11.14.0
Can any one suggest me how to overcome this. Thanks!
Any updates on this? I've tried to add the
"engines": {
"node": "^10.15.3",
},
to the top level of my package.json file, but seems that it's not related to this issue, not affected anything.
Also tried another solution - rm -rf ./node_modules && rm yarn.lock - still no luck.
Hello, node version 11 is EOL according to Node.js Release Schedule. Most of lint-staged's dependencies themselves require versions 8, 10 or 12, and do not support version 11.
What about the 10.15.3 version? Same issue (#https://github.com/typicode/husky/issues/247)
To me that looks like an issue with nvm setting an incorrect node version in $PATH. The only place where lint-staged defines a node version is in the bin (>=8.12.0) here: https://github.com/okonet/lint-staged/blob/master/bin/lint-staged#L19
@iiroj can't confirm - here is what I have in echo $PATH -> ...:/home/oleg/.nvm/versions/node/v10.15.3/bin:...
check what node version you have in ~/.node_path. From the read me: https://github.com/typicode/husky/blob/master/README.md#node-version-managers
if you've installed nvm, use command : nvm list to get your node version
then use command : nvm alias default version_num ,to set the node version to the newest one.
then it works.
For me a similar issue happened when for some reason Webstorm picked up my system node (8.10) during commit, instead of the node from nvm, where the default is 12.
Since I care only about nvm's node, I just did sudo apt-get remove nodejs and then the IDE was no more confused by various node versions and picked up the right one.
In my case Gitkraken started picking my system node (8.1.3) too. I removed it as I'll always use nvm. You can do the same with rm /usr/local/bin/node.
I don't know which side effect it could have though. Do it at your own risks.
if you've installed nvm, use command :
nvm listto get your node version
then use command :nvm alias default version_num,to set the node version to the newest one.
then it works.
this helped me
for me this issue was with nvm,i removed nvm and installed latest version on node again,
rm -rf ~/.nvm
this solved my issue.
for me this issue was with nvm,i removed nvm and installed latest version on node again,
rm -rf ~/.nvm
this solved my issue.
It also solved my issue, thanks
I'll close this issue since it seems there's a fix.
for me this issue was with nvm,i removed nvm and installed latest version on node again,
rm -rf ~/.nvm
this solved my issue.
it works.
for me, I used to use nvm but now I use n. so what I did is to remove .nvm
for me this issue was with nvm,i removed nvm and installed latest version on node again,
rm -rf ~/.nvm
this solved my issue.
nice
Most helpful comment
if you've installed nvm, use command :
nvm listto get your node versionthen use command :
nvm alias default version_num,to set the node version to the newest one.then it works.