使用我创建React应用时遇到问题,我一直遇到错误。
我正在使用节点v10.16.0
和npm v 6.9.0
我已经浏览了许多答案,并尝试了所有建议的操作,包括重新安装节点,清除缓存等。
我在命令提示符下键入了npx create-react-app client
这就是我得到的。
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.16.0
[1/4] Resolving packages...
error Received malformed response from registry for "react". The registry may be down.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd C:\Users\xxxx\Documents\Work Project\client has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting client/ from C:\Users\xxxx\Documents\Work Project
Done.
答案 0 :(得分:0)
一旦你通过运行清理了纱线缓存:
yarn cache clean
删除 AppData 文件夹中的纱线缓存文件夹以及 C:\Users\test\AppData\Local\Yarn
随后调用:
npx create-react-app your-app
这对我很有效