gpt4 book ai didi

node.js - ‘加密’node.js模块: Cannot find package main file for package error

转载 作者:太空宇宙 更新时间:2023-11-04 00:56:40 24 4
gpt4 key购买 nike

我已将加密模块 (npm install crypto) 安装到我的 node.js 项目中,但是当我启动我的应用程序时,出现此错误:

Error: Cannot find package main file for package: /opt/PropertyFinder/node_modules/crypto
at DependecyGraph.resolveDependency (/opt/PropertyFinder/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js:199:13)
at /opt/PropertyFinder/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js:117:22
at Array.forEach (native)
at collect (/opt/PropertyFinder/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js:115:25)
at /opt/PropertyFinder/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js:130:9
at Array.forEach (native)
at collect (/opt/PropertyFinder/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js:115:25)
at /opt/PropertyFinder/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js:130:9
at Array.forEach (native)
at collect (/opt/PropertyFinder/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js:115:25)
at /opt/PropertyFinder/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js:130:9
at Array.forEach (native)
at collect (/opt/PropertyFinder/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js:115:25)
at /opt/PropertyFinder/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js:130:9
at Array.forEach (native)
at collect (/opt/PropertyFinder/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js:115:25)
[7:40:11 PM] <START> request:/index.ios.bundle

这是什么意思?我在哪里可以找到该包的主文件?

最佳答案

也许您打算使用 Node.js 的内置 crypto模块。

如果是这样,您不需要通过 npm 安装它,并且应该能够简单地在代码中 require('crypto')

(首先使用npm uninstall crypto删除“重复项”。)

关于node.js - ‘加密’node.js模块: Cannot find package main file for package error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29476637/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com