Node.js npx运行的节点版本在我的计算机上不存在

Node.js npx运行的节点版本在我的计算机上不存在,node.js,npm,create-react-app,npx,Node.js,Npm,Create React App,Npx,我试图运行此命令npx create react app my app,但出现此错误 error @typescript-eslint/eslint-plugin@4.5.0: The engine "node" is incompatible with this module. Expected version "^10.12.0 || >=12.0.0". Got "11.13.0" error Found incompati

我试图运行此命令
npx create react app my app
,但出现此错误

error @typescript-eslint/eslint-plugin@4.5.0: The engine "node" is incompatible with this module. Expected version "^10.12.0 || >=12.0.0". Got "11.13.0"
error Found incompatible module.
奇怪的是我使用了节点版本15.0.1(最新)和纱线版本1.22.10(最新),npx使用的版本
得到了“11.13.0”
,这在我的机器上并不存在


有人面临这个问题吗?请提前提供帮助,非常感谢。

在Windows上情况可能不同,但在类UNIX操作系统(包括macOS)上,您可以通过以下方式找到npx执行的
节点的路径:

/usr/bin/env node -p process.execPath
这是因为
npx
文件以
#开头/usr/bin/env节点
。因此,您可以使用
/usr/bin/env node
执行与
npx
相同的
节点

-p
表示“打印值”,是指向可执行文件的路径

为什么要执行上述操作而不只是使用
哪个节点
它将报告别名,这意味着它将报告您将在shell中看到的
节点
可执行文件。这不是
npx
将要使用的,这似乎可以解释为什么
npx
可能会使用与预期不同的Node.js版本

$ alias node=echo
$ node foo
foo
$ which node
node: aliased to echo
$ /usr/bin/env node -p process.execPath
/Users/trott/.nvm/versions/node/v15.0.1/bin/node
$

我尝试了
/usr/bin/env node-p process.execPath
,它返回
/usr/bin/env
@thelonglqd,这让我非常惊讶。
/usr/bin/env节点-v
的输出是什么?
/usr/bin/env
:(您使用的是什么操作系统?我使用macOS,它应该是什么输出?