我知道这已经出现过很多次了,但它就是不起作用。我使用 Arch Linux。每次我尝试跑步时
npx create-react-app my-app
或
npm create-react-app my-app
我得到
error @pmmmwh/react-refresh-webpack-plugin@0.4.3: The engine "node" is incompatible with
this module. Expected version ">= 10.x". Got "8.16.0"
error Found incompatible module.
当我输入node -v
时,我得到14.16.1
并npm -v
->7.10.0
看起来节点版本没有更新到 14.x 版本。或? 我尝试更新sudo npm install -g npm
和sudo n stable
.
当我尝试sudo npm install npm@latest -g
时,我得到了很多Missing write access to /usr/local/lib/node_modules/............
。
修复是我通过pacman
和Snap Store
安装了节点(我不知道),我在WebStorm中看到有一些节点v8.16.0
安装。所以我卸载了snap version
它正在工作。看起来create-react-app
正在使用snap version