vue-cli: vue cli fails to get packages when npm is using a custom nexus npm registry

Version

4.3.1

Environment info

System:
    OS: Windows 10 10.0.18362
    CPU: (8) x64 Intel(R) Xeon(R) CPU E3-1505M v6 @ 3.00GHz
  Binaries:
    Node: 12.16.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.16.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 44.18362.449.0
  npmPackages:
    @fortawesome/vue-fontawesome: ^0.1.9 => 0.1.9
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0
    @vue/babel-plugin-transform-vue-jsx:  1.1.2
    @vue/babel-preset-app:  4.3.1
    @vue/babel-preset-jsx:  1.1.2
    @vue/babel-sugar-functional-vue:  1.1.2
    @vue/babel-sugar-inject-h:  1.1.2
    @vue/babel-sugar-v-model:  1.1.2
    @vue/babel-sugar-v-on:  1.1.2
    @vue/cli-overlay:  4.3.1
    @vue/cli-plugin-babel: ^4.3.1 => 4.3.1
    @vue/cli-plugin-eslint: ^4.3.1 => 4.3.1
    @vue/cli-plugin-pwa: ^4.3.1 => 4.3.1
    @vue/cli-plugin-router:  4.3.1
    @vue/cli-plugin-unit-jest: ^4.3.1 => 4.3.1
    @vue/cli-plugin-vuex:  4.3.1
    @vue/cli-service: ^4.3.1 => 4.3.1
    @vue/cli-shared-utils:  4.3.1
    @vue/component-compiler-utils:  3.1.2
    @vue/eslint-config-airbnb: ^5.0.2 => 5.0.2
    @vue/preload-webpack-plugin:  1.1.1
    @vue/test-utils: ^1.0.0-beta.32 => 1.0.0-beta.32
    @vue/web-component-wrapper:  1.2.0
    eslint-plugin-vue: ^6.2.2 => 6.2.2
    jest-serializer-vue:  2.0.2
    svg-to-vue:  0.6.0
    vue: ^2.6.11 => 2.6.11
    vue-analytics: ^5.22.1 => 5.22.1
    vue-autosuggest: ^2.0.4 => 2.0.4
    vue-bus: ^1.2.1 => 1.2.1
    vue-carousel: ^0.18.0 => 0.18.0
    vue-cli-plugin-i18n: ^0.6.1 => 0.6.1
    vue-cli-webpack:  1.0.0
    vue-clickaway: ^2.2.2 => 2.2.2
    vue-cookies: ^1.7.0 => 1.7.0
    vue-eslint-parser:  7.0.0
    vue-headroom: ^0.10.1 => 0.10.1
    vue-hot-reload-api:  2.3.4
    vue-i18n: ^8.16.0 => 8.16.0
    vue-i18n-extract:  1.1.1
    vue-i18n-ts:  0.1.0
    vue-jest:  3.0.5
    vue-loader:  15.9.1
    vue-router: ^3.1.6 => 3.1.6
    vue-social-sharing: ^2.4.7 => 2.4.7
    vue-style-loader:  4.1.2
    vue-svg-loader: ^0.15.0 => 0.15.0
    vue-template-compiler: ^2.6.11 => 2.6.11
    vue-template-es2015-compiler:  1.9.1
    vue-youtube: ^1.4.0 => 1.4.0
    vuex: ^3.1.3 => 3.1.3
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

Add a custom registry which requires authentication in .npmrc, then use vue ui and check plugins/dependencies or try to upgrade a plugin with vue upgrade.

What is expected?

In the case of vue ui the current package version and details on the latest version should be displayed.

What is actually happening?

A 401 error is returned when checking the package in the registry, along with the error “Failed to get response from https://my-nexus-repository.com/repository/npm-proxy/the-package-name


It looks to me like the registry value is taken from the .npmrc file but not the credentials included in the _auth string. I am not behind any proxy and am able to revert my registry to default settings as a workaround but would be much better if I could use this functionality without having to constantly change settings.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 27 (10 by maintainers)

Commits related to this issue

Most upvoted comments

If people are running into this when using vue upgrade then you can append the public npm registry in the command.

vue upgrade --registry https://registry.npmjs.org

@bodograumann If the config in the ~/.npmrc is in the format of @myco:registry=http://reg.example.com, then it’s because I forgot to handle such cases. I’ll try to fix it in the next version.

Fixed in v4.4.5

Still failing for me in @vue/cli@4.5.4, when running serve:

 ERROR  Failed to get response from https://npm.pkg.github.com/company_edited/vue-cli-version-marker

I have a .npmrc in the root of the project with:

registry=https://npm.pkg.github.com/company_edited

Because we are using the Github package registry for private packages:

image

But I can install plugins in the UI with no hassle.

Initial testing with GitBash in Windows:

$ vue upgrade
-  Gathering package information...
 ERROR  TypeError: Cannot convert undefined or null to object
TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at PackageManager.getRemoteVersion (C:\Users\abarker\AppData\Roaming\npm\node_modules\@vue\cli\lib\util\ProjectPackageManager.js:271:16)
    at process._tickCallback (internal/process/next_tick.js:68:7)