介绍

           目前使用ionic+cordova完成hybmid app开发,在安装geolocation插件时爆出来一个莫名的错误:

Fetching from npm failed: CERT_UNTRUSTED
Error: CERT_UNTRUSTED
    at SecurePair.<anonymous> (tls.js:1367:32)
    at SecurePair.emit (events.js:92:17)
    at SecurePair.maybeInitFinished (tls.js:979:10)
    at CleartextStream.read [as _read] (tls.js:471:13)
    at CleartextStream.Readable.read (_stream_readable.js:340:10)
    at EncryptedStream.write [as _write] (tls.js:368:25)
    at doWrite (_stream_writable.js:225:10)
    at writeOrBuffer (_stream_writable.js:215:5)
    at EncryptedStream.Writable.write (_stream_writable.js:182:11)
    at write (_stream_readable.js:601:24)

         原因是因为我自己重新设置了npm仓库为淘宝的npm镜像仓库,由于某些安全原因无法获取cordova的相关插件,解决办法很简单:

npm config set strict-ssl false

以上。

相关文章:

  • 2021-09-23
  • 2022-01-23
  • 2021-04-26
  • 2022-02-27
  • 2022-03-01
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
猜你喜欢
  • 2022-12-23
  • 2021-11-16
  • 2021-09-12
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
  • 2021-12-25
相关资源
相似解决方案