You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run node -v on the command line, I get 7.24.0.
When I run npm show --json eslint-config-xo@latest peerDependencies directly on the command line, I get the expected:
{
"eslint": ">=7.20.0"
}
Instead, suppose I make the following Javascript file as spawntest.js:
//One of the two next lines should be uncommented; doesn't really matter which.//const spawnSync = require("cross-spawn").sync;constspawnSync=require("child_process").spawnSync;constnpmProcess=spawnSync("npm",//['-v'], //Using this instead of the next line gives the same result. ["show","--json","eslint-config-xo@latest","peerDependencies"],{encoding: "utf8"});consterror=npmProcess.error;if(error&&error.code==="ENOENT"){returnnull;}constfetchedText=npmProcess.stdout.trim();console.log('fetchedText is "'+fetchedText+'"');
The result is:
fetchedText is "Sorry, there's a problem with nodist. Couldn't resolve npm version spec 7.24.0 : Couldn't find any matching version"
The init procedure in eslint tries to parse that as JSON, and understandably fails.
This seems like it might be an issue in nodist, so I'm filing a report here.
The text was updated successfully, but these errors were encountered:
Apparently it's looking for 7.24.0 in the list of npm versions which are the names of children directories under os.Getenv("NODIST_PREFIX")+"/npmv" and on my machine, 7.24.0 isn't one of them. However, when I try to run 'nodist npm local 7.24.0' per the documentation, I get the following error:
maybe it's a known issue, as seen in the Known issues:
native modules: Since the node version changes at the mercy of the shim executable, based on env vars, target directory and the global setting, and availability of node versions, it is possible that locally or globally installed node modules that depend on a specific version of node (usually native modules and downloaders) stop working. npm rebuild makes things work again in these cases.
This issue was discovered here.
When I run
node -v
on the command line, I get7.24.0
.When I run
npm show --json eslint-config-xo@latest peerDependencies
directly on the command line, I get the expected:Instead, suppose I make the following Javascript file as
spawntest.js
:The result is:
The init procedure in eslint tries to parse that as JSON, and understandably fails.
This seems like it might be an issue in nodist, so I'm filing a report here.
The text was updated successfully, but these errors were encountered: