cordova plugin add出現CERT_UNTRUSTED錯誤解決方法
小編:管理員 509閱讀 2022.09.13
目前使用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
以上。
相關推薦
- Cordova 什么是Cordova? Cordova是用于使用HTML,CSS和JS構建移動應用的平臺。我們可以認為Cordova是一個容器,用于將我們的網絡應用程序與本機移動功能連接。默認情況下,Web應用程序不能使用本機移動功能。這就是Cordova進來的地方。它為網絡應用和移動設備之間的連…
- Hibernate Criterion 在查詢方法設計上能夠靈活的依據Criteria的特點來方便地進行查詢條件的組裝.Hibernate設計了CriteriaSpecification作為Criteria的父接口,以下提供了Criteria和DetachedCriteria.Criteria和DetachedCriteria的主要差別在于創建的形式不一樣,Criteria是在線的,所…