操作系统-ubuntu
IDE-VS-代码npx create-react-app
工作正常,当我遇到 Create React App requires Node 14 or higher.
的建议时,我想从事个人项目我尝试使用以下命令更新节点 sudo npm cache clean -f
然后 sudo npm install -g n
然后我跑了 sudo n stable
安装了以下内容:v16.13.1(使用 npm 8.1.2)。当我尝试运行 npx create-react-app
我收到以下错误
Error: Cannot find module 'libnpx'
Require stack:
- /usr/share/npm/bin/npx-cli.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/usr/share/npm/bin/npx-cli.js:3:13)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/usr/share/npm/bin/npx-cli.js' ]
}
收到错误后我尝试了什么,下面的解决方案;
React: create-react-app fails with error "Cannot find module 'lodash'"
我该如何解决这个问题,以便我可以开始我的个人项目并学习框架?
最佳答案
重新启动 vs-code 并开始正常工作。希望这可以帮助面临同样错误的人
关于reactjs - react : create-react-app fails with error "Cannot find module ' libnpx',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70402406/