事由為我在 npm 安裝套件時,出現了以下的錯誤資訊
error code ENOTFOUND
error errno ENOTFOUND
error network request to https://registry.npmjs.org/@vue%2fcli failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org
error network This is a problem related to network connectivity.
error network In most cases you are behind a proxy or have bad network settings.
error network
error network If you are behind a proxy, please make sure that the
error network 'proxy' config is set properly. See: 'npm help config'
解決方法為打開終端機(命令提示字元),依序輸入以下三個指令完成後即可正常安裝套件
/* 1. 設定 proxy 為 null */
$ npm config set proxy null
/* 2. 設定 https-proxy 為 null */
$ npm config set https-proxy null
/* 3. 設定 registry */
$ npm config set registry https://registry.npmjs.org/