question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cli beta.15 Ui-based project creation manually sets the npm registry to https://registry.npm.taobao.org for some of the npm install commands

See original GitHub issue

Version

3.0.0-beta.15

Reproduction link

https://github.com/vuejs/vue-cli

Steps to reproduce

Create a new project by running vue ui and following the prompts. Choose manual preset, then include Router, SCSS support, Unit tests, and eslint. Allow dependencies to install, which will run an npm install command that against the https://registry.npm.taobao.org mirror

What is expected?

Expected: project will be created with all dependencies installed correctly

What is actually happening?

Let me say first I know this is an abnormal issue that is against the rules, I just really did not think this behavior is intentional, and since the issue is based around a physical geographic separation I cannot provide a reliable link for anyone in the world to reproduce.

Actual: the command npm install --loglevel error --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao.org/dist is executed, which forces npm to use the taobao registry. Since this server is in China, and I am in the US, I eventually get an invalid checksum on a package. I know this is an odd issue to report, since it is up to chance, but I have tried this over 6 times throughout the day to the same error. I tried all the common solutions like running npm cache clean --force.

I understand this is not a vue.js problem, but I assumed this was being set by mistake. Is there a reason the npm install command is forcing the registry to use the Chinese server?


gyp ERR! System Darwin 17.5.0 gyp ERR! command “/usr/local/bin/node” “/Users/brandon/mcity/mcity-vue-frontend/node_modules/node-gyp/bin/node-gyp.js” “rebuild” “–verbose” “–libsass_ext=” “–libsass_cflags=” “–libsass_ldflags=” “–libsass_library=” gyp ERR! cwd /Users/brandon/mcity/mcity-vue-frontend/node_modules/node-sass gyp ERR! node -v v8.9.0 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok Build failed with error code: 1 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! node-sass@4.9.0 postinstall: node scripts/build.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-sass@4.9.0 postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/brandon/.npm/_logs/2018-06-01T20_28_41_638Z-debug.log command failed: npm install --loglevel error --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao.org/dist

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
yyx990803commented, Jun 1, 2018

This probably happened when the npm registry itself was having a slow response so the CLI inferred it would be faster to use the Taobao mirror… however, there should be a CLI prompt asking you whether that is ok. That seems to be missed when creating from UI? /cc @Akryum

You can manually turn this behavior off by editing ~/.vuerc and set useTaobaoRegistry to false.

2reactions
hiendvcommented, Jun 12, 2020

Regarding the connection speed, I think it’s okay to switch registry with consent from users. But for me, I’m not really comfortable if vue tries to make that registry global. S̶o̶ ̶i̶n̶s̶t̶e̶a̶d̶ ̶o̶f̶ ̶r̶u̶n̶n̶i̶n̶g̶ t̶h̶i̶s̶ ̶c̶o̶m̶m̶a̶n̶d̶, h̶o̶w̶ ̶a̶b̶o̶u̶t̶ ̶s̶e̶t̶t̶i̶n̶g̶ ̶t̶h̶e̶ ̶r̶e̶g̶i̶s̶t̶r̶y̶ ̶p̶e̶r̶ ̶p̶r̶o̶j̶e̶c̶t̶ ̶u̶s̶i̶n̶g̶ .n̶p̶m̶r̶c̶ f̶i̶l̶e̶?

Update: I read the source again and my above comment is irrelevant because it’s actually “getting” not “setting” (I was day-dreaming 🤣). I also tried to re-produce “global” issue but its impossible for me. @vue/cli saves shouldUseTaobao into ~/.vuerc and use it for future @vue/cli tasks. The global npm registry remains untouched. Other npm install should not pick this registry. https://github.com/vuejs/vue-cli/blob/e2f00d2867269b411c7b1a7c703b7222a6185d84/packages/%40vue/cli/lib/util/ProjectPackageManager.js#L157-L164

So, @vue/cli works as expected I guess 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

registry
To resolve packages by name and version, npm talks to a registry website that implements the CommonJS Package Registry specification for reading package...
Read more >
npm packages in the Package Registry - GitLab Docs
The GitLab npm repository supports the following commands for the npm CLI ( npm ) and yarn CLI ( yarn ):. npm install...
Read more >
273
The config part is not necessary, can run just npm get registry to see your current, and npm set registry https://registry.npmjs.org/ to set...
Read more >
How to Install npm, Master npm Commands & Use Packages
Install npm Updates. npm, which originally stood for Node Package Manager, is a separate project from Node.js. It tends to be updated more ......
Read more >
npmrc
For example, setting @babel:registry=https://example.com/packages/npm/ will enforce that when you use pnpm add @babel/core , or any @babel scoped package, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found