Npm 安裝提示 EUNSUPPORTEDPROTOCOL 錯誤

語言: CN / TW / HK

完整的錯誤資訊為:

14 verbose stack Error: Unsupported URL Type "npm:": npm:@elastic/[email protected]7.13.0
14 verbose stack     at unsupportedURLType (C:\Users\huyuc\AppData\Roaming\nvm\v8.9.4\node_modules\npm\node_modules\npm-package-arg\npa.js:197:15)
14 verbose stack     at fromURL (C:\Users\huyuc\AppData\Roaming\nvm\v8.9.4\node_modules\npm\node_modules\npm-package-arg\npa.js:250:13)
14 verbose stack     at Function.resolve (C:\Users\huyuc\AppData\Roaming\nvm\v8.9.4\node_modules\npm\node_modules\npm-package-arg\npa.js:71:12)
14 verbose stack     at module.exports (C:\Users\huyuc\AppData\Roaming\nvm\v8.9.4\node_modules\npm\lib\install\realize-shrinkwrap-specifier.js:21:14)
14 verbose stack     at BB.each (C:\Users\huyuc\AppData\Roaming\nvm\v8.9.4\node_modules\npm\lib\install\inflate-shrinkwrap.js:51:23)
14 verbose stack     at tryCatcher (C:\Users\huyuc\AppData\Roaming\nvm\v8.9.4\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
14 verbose stack     at Object.gotValue (C:\Users\huyuc\AppData\Roaming\nvm\v8.9.4\node_modules\npm\node_modules\bluebird\js\release\reduce.js:155:18)
14 verbose stack     at Object.gotAccum (C:\Users\huyuc\AppData\Roaming\nvm\v8.9.4\node_modules\npm\node_modules\bluebird\js\release\reduce.js:144:25)
14 verbose stack     at Object.tryCatcher (C:\Users\huyuc\AppData\Roaming\nvm\v8.9.4\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
14 verbose stack     at Promise._settlePromiseFromHandler (C:\Users\huyuc\AppData\Roaming\nvm\v8.9.4\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
14 verbose stack     at Promise._settlePromise (C:\Users\huyuc\AppData\Roaming\nvm\v8.9.4\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
14 verbose stack     at Promise._settlePromise0 (C:\Users\huyuc\AppData\Roaming\nvm\v8.9.4\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
14 verbose stack     at Promise._settlePromises (C:\Users\huyuc\AppData\Roaming\nvm\v8.9.4\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
14 verbose stack     at Async._drainQueue (C:\Users\huyuc\AppData\Roaming\nvm\v8.9.4\node_modules\npm\node_modules\bluebird\js\release\async.js:133:16)
14 verbose stack     at Async._drainQueues (C:\Users\huyuc\AppData\Roaming\nvm\v8.9.4\node_modules\npm\node_modules\bluebird\js\release\async.js:143:10)
14 verbose stack     at Immediate.Async.drainQueues (C:\Users\huyuc\AppData\Roaming\nvm\v8.9.4\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
15 verbose cwd D:\WorkDir\FacilityConneX\Source-Code\Services\API
16 verbose Windows_NT 10.0.19043
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--frozen-lockfile"
18 verbose node v8.9.4
19 verbose npm  v5.6.0
20 error code EUNSUPPORTEDPROTOCOL
21 error Unsupported URL Type "npm:": npm:@elastic/[email protected]7.13.0
22 verbose exit [ 1, true ]

從上面的錯誤資訊我們來抓重點看就是第一行 verbose stack Error: Unsupported URL Type "npm:": npm:@elastic/[email protected]

Unsupported URL Type 這個錯誤。

錯誤原因和解決

出現這個錯誤的原因是你的 node 版本可能過低了。

你需要切換使用更高一點的 node 版本。

如果你對切換 node 的版本和 NPM 之間的關係有什麼不清楚的話,可以參考下面的內容:NPM 和 NVM

當你切換 node 版本完成後,再次嘗試安裝就應該能夠解決你的這個問題了。

 

 

當我們切換版本完成後再次進行安裝,就能夠成功了。

 

https://www.ossez.com/t/npm-eunsupportedprotocol/13728