Node.js   发布时间:2022-04-24  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了node.js – 在公司防火墙后面使用create-react-app大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
通过设置代理,可以使用create-react-app在公司防火墙后面工作.

我已经在Npm和yarn上设置了代理,但这是我在尝试创建 – react-app my-app时看到的:

CreaTing a new React app in F:\react\my-app.

Installing packages. This might take a couple of minutes.
Installing react,react-dom,and react-scripts...

You appear to be offline.
falling BACk to the local Yarn cache.

yarn add v0.23.4
info No lockfile found.
[1/4] Resolving packages...
error Couldn't find any versions for "react" that matches "latest" in our cache. Possible versions: ""
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

AborTing installation.
  yarnpkg add --exact --offline react react-dom react-scripts has Failed.

deleting generated file... package.json
deleting my-app / from F:\react
Done.

解决方法

作为一种解决方法,首先尝试在空文件夹中运行yarn add react react-dom react-scripts.这会将所需的包添加到yarn的本地缓存中.然后,您可以删除文件夹并再次运行create-react-app my-app,它将有希望工作.

大佬总结

以上是大佬教程为你收集整理的node.js – 在公司防火墙后面使用create-react-app全部内容,希望文章能够帮你解决node.js – 在公司防火墙后面使用create-react-app所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。