找不到模块node_modules\chalk\source'。请验证 package.json 是否具有有效的“main”入口
我更新了 node、npm 和 expo-cli,现在每次运行“Npm start”时都会遇到这个问题,
Cannot find module 'C:\Users\xyz\projects\abc\node_modules\chalk\source'. Please verify that the package.json has a valid "main" entry
Error: Cannot find module 'C:\Users\xyz\projects\abc\node_modules\chalk\source'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:353:19)
at Function.Module._findPath (node:internal/modules/cjs/loader:566:18)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
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> (C:\Users\xyz\projects\abc\node_modules\metro\src\index.js:110:15)
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)
Metro Bundler 无法启动。有人面临同样的问题吗?任何帮助将不胜感激。
I updated node, npm and expo-cli now I'm facing this issue every time i run "Npm start"
Cannot find module 'C:\Users\xyz\projects\abc\node_modules\chalk\source'. Please verify that the package.json has a valid "main" entry
Error: Cannot find module 'C:\Users\xyz\projects\abc\node_modules\chalk\source'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:353:19)
at Function.Module._findPath (node:internal/modules/cjs/loader:566:18)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
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> (C:\Users\xyz\projects\abc\node_modules\metro\src\index.js:110:15)
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)
Metro Bundler doesn't start. Anyone who's facing the same issue? any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
rm -rf node_modules && npm 安装
rm -rf node_modules && npm install