node.js - NPM 安装失败 - 错误 :0906D06C:PEM routines:PEM_read_bio:no start line

标签 node.js npm certificate installation pem

我尝试从 npm 安装 expo 软件包,但在安装过程中,我收到错误,错误:0906D06C:PEM 例程:PEM_read_bio:无起始行,多次尝试获取 .tar.gz 文件,然后安装失败。

我环顾四周,但我所能找到的只是 examples当人们设置自己的服务器并遇到证书问题时会出现该错误。但我并不是要设置服务器,而是要下载软件包,我没有任何证书需要修复。我查看了 ~/.ssh 目录中的 id_rsa 文件,它似乎格式良好,带有开始和结束分隔符。

我认为这可能是软件包的问题,​​但我有一位同事尝试安装该软件包,并且它对他们有用。

知道我做错了什么吗?我怀疑这是我的 npm 安装或配置的问题,但我不知道应该更改什么。

npm debug log

这是完整的输出:

Nathaniels-MacBook-Pro:testexpo kiddynamo$ node -v
v6.11.0
Nathaniels-MacBook-Pro:testexpo kiddynamo$ npm -v
3.10.10
Nathaniels-MacBook-Pro:testexpo kiddynamo$ npm install --save expo
npm ERR! fetch failed https://github.com/callstack-io/react-native-fbads/tarball/v4.1.0
npm WARN retry will retry, error on last attempt: Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
npm ERR! fetch failed https://github.com/expo/react-native-svg/archive/5.2.0-exp.0.tar.gz
npm WARN retry will retry, error on last attempt: Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
npm ERR! fetch failed https://github.com/expo/react-native-maps/archive/v0.15.2.tar.gz
npm WARN retry will retry, error on last attempt: Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
npm ERR! fetch failed https://github.com/callstack-io/react-native-fbads/tarball/v4.1.0
npm WARN retry will retry, error on last attempt: Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
npm ERR! fetch failed https://github.com/expo/react-native-svg/archive/5.2.0-exp.0.tar.gz
npm WARN retry will retry, error on last attempt: Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
npm ERR! fetch failed https://github.com/expo/react-native-maps/archive/v0.15.2.tar.gz
npm WARN retry will retry, error on last attempt: Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
npm ERR! fetch failed https://github.com/callstack-io/react-native-fbads/tarball/v4.1.0
npm ERR! fetch failed https://github.com/expo/react-native-svg/archive/5.2.0-exp.0.tar.gz
npm ERR! fetch failed https://github.com/expo/react-native-maps/archive/v0.15.2.tar.gz
npm ERR! Darwin 16.6.0
npm ERR! argv "/Users/kiddynamo/.nvm/versions/node/v6.11.0/bin/node" "/Users/kiddynamo/.nvm/versions/node/v6.11.0/bin/npm" "install" "--save" "expo"
npm ERR! node v6.11.0
npm ERR! npm  v3.10.10

npm ERR! error:0906D06C:PEM routines:PEM_read_bio:no start line
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/kiddynamo/git/barback/testexpo/npm-debug.log

最佳答案

我终于找到了解决这个问题的方法。通过 NVM 卸载 Node 并删除我的 ~/.nvm、~/.npm、~/.node-gyp 和 ~/.node_repl_history 目录,然后重新安装 Node 修复了该问题。不能 100% 确定原因,但希望这对遇到相同问题的任何人都有帮助。

关于node.js - NPM 安装失败 - 错误 :0906D06C:PEM routines:PEM_read_bio:no start line,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44804976/

相关文章:

javascript - 使用 request-promise 抓取网站价格时出现 403 错误

javascript - tsc 不创建 dist 文件夹

node.js - 使用node-gyp配置构建时的node-api.h问题

javascript - 如何使用 Visual Studio 2017 创建 NPM 包?

用于提取相关 CSS 的 JavaScript 库

WCF - 部署证书

javascript - 如何通过路由器从 html 表单传递字符串以生成和存储对象?

docker - OpenStack上的Docker在获取之后和生命周期之前,npm卡住了

ssl - 将 Comodo SSL 与 AWS 证书链结合使用

java - 数字签名错误 - 签名长度不正确 : got 344 but was expecting 256