简体   繁体   English

React native / node 问题:成功找到 package。 但是,package 指定了一个无法解析的“主”模块字段

[英]React native / node issue: The package was successfully found. However, the package specifies a `main` module field that could not be resolved

I am new to node and React Native and I have an issue that I hope someone can help me resolve.我是 node 和 React Native 的新手,我有一个问题希望有人能帮我解决。 I and another person are making a React Native application and currently I am trying to piece together a backend made by the other person with my frontend and I get the following error:我和另一个人正在制作一个 React Native 应用程序,目前我正在尝试将另一个人制作的后端与我的前端拼凑在一起,我收到以下错误:

While trying to resolve module http from file /Users/alex/ParkME/node_modules/node-fetch/index.js , the package /Users/alex/ParkME/node_modules/http/package.json was successfully found. While trying to resolve module http from file /Users/alex/ParkME/node_modules/node-fetch/index.js , the package /Users/alex/ParkME/node_modules/http/package.json was successfully found. However, this package itself specifies a main module field that could not be resolved ( /Users/alex/ParkME/node_modules/http/index.js . Indeed, none of these files exist:但是,这个 package 本身指定了一个无法解析的main模块字段( /Users/alex/ParkME/node_modules/http/index.js 。事实上,这些文件都不存在:

  • /Users/alex/ParkME/node_modules/http/index.js(.native||.ios.expo.js|.native.expo.js|.expo.js|.ios.expo.ts|.native.expo.ts|.expo.ts|.ios.expo.tsx|.native.expo.tsx|.expo.tsx|.ios.expo.json|.native.expo.json|.expo.json|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
  • /Users/alex/ParkME/node_modules/http/index.js/index(.native||.ios.expo.js|.native.expo.js|.expo.js|.ios.expo.ts|.native.expo.ts|.expo.ts|.ios.expo.tsx|.native.expo.tsx|.expo.tsx|.ios.expo.json|.native.expo.json|.expo.json|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx) Failed building JavaScript bundle. /Users/alex/ParkME/node_modules/http/index.js/index(.native||.ios.expo.js|.native.expo.js|.expo.js|.ios.expo.ts|.native.expo.ts|.expo.ts|.ios.expo.tsx|.native.expo.tsx|.expo.tsx|.ios.expo.json|.native.expo.json|.expo.json|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx) Failed构建 JavaScript 捆绑包。

Does anyone know what the issue might be?有谁知道问题可能是什么?

Is the error coming from your backend or frontend code?错误来自您的后端还是前端代码? And were the node modules included in the code you got from the other person?您从其他人那里获得的代码中是否包含节点模块? You can try running npm install command on the directory to update the dependencies if you haven't already.如果尚未更新依赖项,您可以尝试在目录上运行npm install命令来更新依赖项。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 `Firebase` package 已成功找到。 但是,这个 package 本身指定了一个无法解析的“主”模块字段 - `Firebase` package was successfully found. However, this package itself specifies a `main` module field that could not be resolved firebase 包已成功找到。 这个包本身指定了一个无法解析的“主”模块字段。 这些文件都不存在 - firebase package was successfully found. this package itself specifies a `main` module field that could not be resolved. none of these files exist 这个 package 本身指定了一个无法解析的“主”模块字段 - This package itself specifies a `main` module field that could not be resolved react-native 包指定了一个主模块 https 模块 - react-native package specifices a main module https module 找不到模块'react-native-foo-package'的声明文件 - Could not find a declaration file for module 'react-native-foo-package' 未找到模块:包路径 ./react 未从包 E:\\NextApp\\portfolio_website-main\\portfolio_website-main\\node_modules\\next-auth 导出 - Module not found: Package path ./react is not exported from package E:\NextApp\portfolio_website-main\portfolio_website-main\node_modules\next-auth React Native 找不到模块 - React Native the module could not be found .min或src作为node_module的package.json中的“main”-file - .min or src as “main”-file in package.json for node_module 找不到模块:无法使用 npm package 解析“反应” - Module not found: Can't resolve 'React' using npm package 找不到模块:包路径。 不从包中导出 - Module not found: Package path . is not exported from package
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM