错误:在 React Native 中运行"npm start"时找不到模块'xdl'



所以我最近开始通过Udemy课程学习React Native。到目前为止,一切都工作得很好,但是几天前,我在运行简单的"npm start"时得到了这个错误信息。命令。我尝试了一些解决方案,如重新安装node_modules文件夹,将所有内容更新到最新版本,但这没有帮助。有人能解决这个问题吗?

node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'xdl'
Require stack:
- C:UsersKorisnikAppDataRoamingnpmnode_modulesexpo-clibuildexp.js
- C:UsersKorisnikAppDataRoamingnpmnode_modulesexpo-clibinexpo.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 _xdl (C:UsersKori
snikAppDataRoamingnpmnode_modulesexpo-clibuildexp.js:152:16)
at Object.<anonymous> (C:UsersKorisnikAppDataRoamingnpmnode_modulesexpo-clibuildexp.js:282:1)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\Users\Korisnik\AppData\Roaming\npm\node_modules\expo-cli\build\exp.js',
'C:\Users\Korisnik\AppData\Roaming\npm\node_modules\expo-cli\bin\expo.js'
]
}

提前感谢!

下载Git Bash并安装,安装完成后以管理员身份打开并编写代码

npm install -g expo-cli --force

相关内容

  • 没有找到相关文章

最新更新