【发布时间】:2020-03-06 08:41:52
【问题描述】:
基于https://github.com/facebook/create-react-app我运行:
npx create-react-app my-app
但我收到此错误:
error An unexpected error occurred: "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz: unable to get local issuer certificate".
我一周前尝试过,它适用于另一个项目。现在它似乎不再起作用了。 未创建文件夹结构。
我尝试将 strict-ssl 设置为 false,但它不能解决问题。有什么建议吗?
【问题讨论】:
-
尝试创建一个名为 my-app 的文件夹,在 my-app 文件夹中打开终端,然后运行
npx create-react-app .或者如果问题仍然存在,请尝试使用 npm :npm install create-react-app -g然后create-react-app my-app -
在他们的文档中,他们不建议这样做:“如果您以前通过 npm install -g create-react-app 全局安装了 create-react-app,我们建议您使用 npm 卸载该软件包卸载 -g create-react-app 以确保 npx 始终使用最新版本。”
-
@paulalexandru 谢谢你,你建议卸载 create-react-app global 为我修复了它。
标签: reactjs ssl npm certificate create-react-app