遇到错误,无法完成 substrate 前端模板的 yarn 安装。

9

按照这里提供的安装步骤进行操作。

使用 node 版本 v16.14.0 完成以下步骤。

git clone https://github.com/substrate-developer-hub/substrate-front-end-template
yarn install

错误代码

Resolution step
➤ YN0002: │ eslint-config-react-app@npm:7.0.0 [e199f] doesn't provide @babel/plugin-syntax-flow (p79568), requested by eslint-plugin-flowtype
➤ YN0002: │ eslint-config-react-app@npm:7.0.0 [e199f] doesn't provide @babel/plugin-transform-react-jsx (p2880e), requested by eslint-plugin-flowtype
➤ YN0002: │ react-dev-utils@npm:12.0.0 doesn't provide typescript (p08c91), requested by fork-ts-checker-webpack-plugin
➤ YN0002: │ react-dev-utils@npm:12.0.0 doesn't provide webpack (pf80ce), requested by fork-ts-checker-webpack-plugin
➤ YN0002: │ react-scripts@npm:5.0.0 [9c894] doesn't provide autoprefixer (peca2e), requested by tailwindcss
➤ YN0060: │ react-scripts@npm:5.0.0 [9c894] provides eslint (p3d1f2) with version 8.6.0, which doesn't satisfy what eslint-config-react-app and some of its descendants request
➤ YN0002: │ substrate-front-end-template@workspace:. doesn't provide eslint (p83184), requested by eslint-config-prettier
➤ YN0002: │ substrate-front-end-template@workspace:. doesn't provide webpack (p9e29f), requested by node-polyfill-webpack-plugin
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 245ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ semantic-ui-css@https://github.com/Semantic-Org/Semantic-UI-CSS.git#commit=01e4a5346496c284db3b19a102458731ccccd911 can't be found in the cache and will be fe
➤ YN0013: │ semantic-ui-css@https://github.com/Semantic-Org/Semantic-UI-CSS.git#commit=01e4a5346496c284db3b19a102458731ccccd911 can't be found in the cache and will be fe
➤ YN0018: │ semantic-ui-css@https://github.com/Semantic-Org/Semantic-UI-CSS.git#commit=01e4a5346496c284db3b19a102458731ccccd911: The remote archive doesn't match the expected checksum
➤ YN0000: └ Completed in 8s 74ms
➤ YN0000: Failed with errors in 8s 327ms
2个回答

24

通过执行以下步骤解决了它

yarn cache clean --all
yarn install

此时,遇到了相同的错误。然后运行以下代码:

YARN_CHECKSUM_BEHAVIOR=update yarn

感谢来自Github讨论的答案。


0
我试过这个。
yarn cache clean --all

但问题是,在rebase之后,yarn lock文件完全混乱了,导致安装失败。
我删除了yarn.lock文件和.node-module文件夹,然后再次运行yarn install。
rmdir .node-modules
rm yarn.lock
yarn install

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接