我正在尝试所有可能的方法来创建一个React应用程序。我尝试过Maven,现在我正在尝试从Facebook孵化器创建-反应-应用程序。

当我尝试在npm环境中运行create-react-app my-app命令时,它在我的个人系统上运行没有问题。但是,当我在我的工作环境中尝试相同的命令时,我在命令行上遇到了以下错误:

npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY

npm ERR! unable to get local issuer certificate
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

当前回答

一些原理图在引擎盖下使用纱线,并抛出相同的错误。

Yarn配置设置注册表http://registry.npmjs.org

其他回答

一些原理图在引擎盖下使用纱线,并抛出相同的错误。

Yarn配置设置注册表http://registry.npmjs.org

我从C:\Users\MyUser中删除了.npmrc文件,它工作了

当我试图更新npm时,我遇到了这个错误,但在AWS Linux中从yum安装了一个非常旧的版本(1.3.6 !)我可以手动安装一个更新的npm版本,一切都得到了补救。

同样的错误。看起来它与SSL证书有关。如果您正在对公共包使用NPM(不需要HTTPS的安全性),您可以使用以下命令关闭严格的SSL密钥验证。

如果您只是希望一次性安装几个公开可用的软件包,这可能是最简单的解决方案。

npm config set strict-ssl=false

这个问题很容易解决。

错误

npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY 
npm ERR! errno UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm ERR! request to https://registry.npmjs.org/yarn failed, reason: unable to get local issuer certificate  
npm ERR! A complete log of this run can be found in:

解决方案

如果您在组织或内部网中,请使用以下推荐。

NPM配置注册表 https://type_your_org_repo_fqdn

其他明智的

NPM配置设置注册表http://registry.npmjs.org/