如何解决错误:打包失败:ReferenceError:文件的SHA-1未计算

huangapple go评论53阅读模式
英文:

How to remove error: bundling failed: ReferenceError: SHA-1 for file is not computed

问题

I've tried to connect mysql with my react-native app. I install express, body-parser, and mysql also. Then I create server.js in my project and type "node server.js" in the terminal. Then I get this error:

错误: 打包失败: 引用错误: /usr/local/lib/node_modules/react-native/node_modules/metro/src/lib/polyfills/require.js (/usr/local/lib/node_modules/react-native/node_modules/metro/src/lib/polyfills/require.js) 的SHA-1未计算

I don't know what this is and how to solve this error. Please help me with this error...

Note: I'm using Ubuntu.

英文:

如何解决错误:打包失败:ReferenceError:文件的SHA-1未计算I've tried to connect mysql with my react-navtive app. I install express, body-parser and mysql also then I create server.js in my project and type "node server.js" cmd on terminal then I get this error

error: bundling failed: ReferenceError: SHA-1 for file /usr/local/lib/node_modules/react-native/node_modules/metro/src/lib/polyfills/require.js (/usr/local/lib/node_modules/react-native/node_modules/metro/src/lib/polyfills/require.js) is not computed

I don't know what is this and how to solve this error please help me with this error...

Note: I'm using ubuntu

答案1

得分: 3

你的react-native-cli版本是多少?

也许需要更新react-native-cli:

npm i -g react-native-cli

英文:

What's your react-native-cli version?

Perhaps, update the react-native-cli:

npm i -g react-native-cli

答案2

得分: 0

尝试使用以下命令运行:

npm run start --reset-cache 或者 react-native start --reset-cache

英文:

Try running using this

npm run start --reset-cache OR react-native start --reset-cache

答案3

得分: 0

对我来说,问题出在我的目录文件夹中有一个 .,所以将 example.com 改为 examplecom 解决了我的问题。

英文:

For me it twas the fact that I had a . in my directory folder so example.com to examplecom had fixed the issue for me

huangapple
  • 本文由 发表于 2020年1月3日 17:35:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/59576111.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定