亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Vue3 CLI 不斷詢問網(wǎng)路連線速度慢的問題
P粉127901279
P粉127901279 2023-09-04 13:16:33
0
1
983
<p>在E2E測試過程中,我透過Vue CLI自動安裝Vue3,確切的指令是:</p> <pre class="brush:php;toolbar:false;">npx --yes @vue/cli create vue3 --packageManager npm -n -i '{"useConfigFiles":true,"plugins":{ "@vue/cli-plugin-babel":{},"@vue/cli-plugin-typescript":{"classComponent":false,"useTsWithBabel":true},&clit; plugin-pwa":{},"@vue/cli-plugin-router":{"historyMode":true},"@vue/cli-plugin-vuex":{},"@vue/clicli] -plugin-eslint":{"config":"prettier","lintOn":["save"]}},"vueVersion":"3"]}},"vueVersion":"3" <p>問題是,在這個過程中,這個問題不斷出現(xiàn):</p> <pre class="brush:php;toolbar:false;">? Your connection to the default yarn registry seems to be slow. Use https://registry.npmmirror.com for faster installation? (Y/n)</pre> <p>由於正在等待輸入,因此建置失敗。如何取消此提示? </p>
P粉127901279
P粉127901279

全部回覆(1)
P粉412533525

我透過查看Vue CLI原始碼找到了解決方案。如果您使用登錄機(jī)碼參數(shù)執(zhí)行 create 指令,或者可以設(shè)定環(huán)境變數(shù) VUE_CLI_TEST 以避免出現(xiàn)該提示。由於我不知道設(shè)定該變數(shù)還有什麼其他影響,因此我使用註冊表命令運(yùn)行。 這是src中的程式碼,shouldUseTaobao是負(fù)責(zé)提示的函數(shù):

    const args = minimist(process.argv, {
      alias: {
        r: 'registry'
      }
    })

    let registry
    if (args.registry) {
      registry = args.registry
    } else if (!process.env.VUE_CLI_TEST && await shouldUseTaobao(this.bin)) {
      registry = registries.taobao
    } else {
      try {
        if (scope) {
          registry = (await execa(this.bin, ['config', 'get', scope + ':registry'])).stdout
        }
        if (!registry || registry === 'undefined') {
          registry = (await execa(this.bin, ['config', 'get', 'registry'])).stdout
        }
      } catch (e) {
        // Yarn 2 uses `npmRegistryServer` instead of `registry`
        registry = (await execa(this.bin, ['config', 'get', 'npmRegistryServer'])).stdout
      }
    }
最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板