Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create a new project or upgrade existing one #5802

Closed
jacekkarczmarczyk opened this issue Aug 18, 2020 · 7 comments · Fixed by #5808
Closed

Can't create a new project or upgrade existing one #5802

jacekkarczmarczyk opened this issue Aug 18, 2020 · 7 comments · Fixed by #5808

Comments

@jacekkarczmarczyk
Copy link

Version

4.5.4

Reproduction link

n/a
just run vue create

Environment info

  System:
    OS: Windows 10 10.0.18362
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Binaries:
    Node: 12.10.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.19.0 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.10.3 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 84.0.4147.125
    Edge: Spartan (44.18362.449.0)
  npmPackages:
    @ant-design-vue/babel-helper-vue-transform-on:  1.0.1
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0
    @vue/babel-plugin-transform-vue-jsx:  1.1.2
    @vue/babel-preset-app:  4.5.4
    @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.5.4
    @vue/cli-plugin-babel: ~4.5.0 => 4.5.4
    @vue/cli-plugin-eslint: ~4.5.0 => 4.5.4
    @vue/cli-plugin-router:  4.5.4
    @vue/cli-plugin-typescript: ~4.5.0 => 4.5.4
    @vue/cli-plugin-unit-jest: ~4.5.0 => 4.5.4
    @vue/cli-plugin-vuex:  4.5.4
    @vue/cli-service: ~4.5.0 => 4.5.4
    @vue/cli-shared-utils:  4.5.4
    @vue/component-compiler-utils:  3.2.0
    @vue/preload-webpack-plugin:  1.1.2
    @vue/web-component-wrapper:  1.2.0
    jest-serializer-vue:  2.0.2
    vue-hot-reload-api:  2.3.4
    vue-jest:  3.0.6
    vue-loader:  15.9.3 (16.0.0-beta.5)
    vue-style-loader:  4.1.2
    vue-template-es2015-compiler:  1.9.1
  npmGlobalPackages:
    @vue/cli: Not Found

Note that npmGlobalPackages shows @vue/cli: Not Found, but i can still run vue command and I've run npm i -g @vue/cli just before running vue info

Steps to reproduce

run vue create (select vue 2 default settings)

What is expected?

project is created

What is actually happening?

image

Contents of yarn-error.log

Arguments: 
  C:\Program Files\nodejs\node.exe C:\Users\PC\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js

PATH: 
  C:\cygwin64\home\PC\jacekkarczmarczyk\vue-upgrade-no-bug\node_modules\.bin;C:\cygwin64\home\PC\jacekkarczmarczyk\node_modules\.bin;C:\cygwin64\home\PC\node_modules\.bin;C:\cygwin64\home\node_modules\.bin;C:\cygwin64\node_modules\.bin;C:\node_modules\.bin;C:\Program Files\nodejs;C:\Users\PC\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\PC\bin;C:\Program Files\ImageMagick-7.0.8-Q16;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Program Files\PuTTY;C:\wamp64\bin\php\php7.4.0;C:\ProgramData\ComposerSetup\bin;C:\Users\PC\AppData\Local\Microsoft\WindowsApps;C:\Users\PC\AppData\Roaming\npm;C:\Users\PC\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\PC\AppData\Roaming\Composer\vendor\bin;C:\wamp64\bin\mariadb\mariadb10.4.10\bin;C:\Program Files (x86)\GitHub CLI;C:\Users\PC\AppData\Local\GitHubDesktop\bin;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl

Yarn version: 
  1.19.0

Node version: 
  12.10.0

Platform: 
  win32 x64

Trace: 
  Error: �[2K�[1Ghttps://registry.yarnpkg.com/@vue%2fcli-plugin-babel: Invalid URI "�[2K�[1Ghttps://registry.yarnpkg.com/@vue%2fcli-plugin-babel"
      at Request.module.exports.Request.init (C:\Users\PC\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:140627:31)
      at new Request (C:\Users\PC\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:140481:8)
      at request (C:\Users\PC\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:137387:10)
      at RequestManager.execute (C:\Users\PC\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:66970:15)
      at RequestManager.shiftQueue (C:\Users\PC\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:67008:10)
      at C:\Users\PC\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:66687:13
      at new Promise (<anonymous>)
      at new F (C:\Users\PC\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:5301:28)
      at RequestManager.request (C:\Users\PC\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:66685:19)
      at NpmRegistry.<anonymous> (C:\Users\PC\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:31704:42)

npm manifest: 
  {
    "name": "vue-upgrade-no-bug",
    "version": "0.1.0",
    "private": true,
    "devDependencies": {
      "@vue/cli-plugin-babel": "~4.5.0",
      "@vue/cli-plugin-typescript": "~4.5.0",
      "@vue/cli-plugin-eslint": "~4.5.0",
      "@vue/cli-plugin-unit-jest": "~4.5.0",
      "@vue/cli-service": "~4.5.0"
    }
  }

yarn manifest: 
  No manifest

Lockfile: 
  No lockfile 

I don't think this is a yarn bug, when i run yarn in the project folder dependencies are sucessfully installed, but I still can't run vue upgrade there:

image

@haoqunjiang
Copy link
Member

I think it's likely a network issue. Could you try this again and see if it works now?

@jacekkarczmarczyk
Copy link
Author

I did try just now, I also cleared yarn cache, I'm having this problem since few days (weeks?) and there are no problems with installing dependencies using yarn or any other network related.

I could also do vue upgrade before till version 4.3 or so, I don't remember, but now Ican't do it even with olde versions of @vue/cli, I managed to create a new project after installing 3.x. Here's the log from trying with 4.1

clear && yarn cache clean && npm remove -g @vue/cli && npm i -g @vue/cli@4.1.0 && vue create test

image

@haoqunjiang
Copy link
Member

How about running this command and try again?

yarn config set registry https://registry.yarnpkg.com

Seems you have misconfigured the yarn registry with the �[2K�[1G prefix.

@jacekkarczmarczyk
Copy link
Author

image

and then running clear && yarn cache clean && npm remove -g @vue/cli && npm i -g @vue/cli && vue create test resulted in the same error

Feel free to close the issue as it's probably related to some misconfiguration on my side and may be hardly reproducible, but I don't recally any changes in my env other than just upgrading deps. I'll try to search for help in yarn repo as well

@haoqunjiang
Copy link
Member

I don't have cygwin installed on this machine so I can't reproduce this issue now. But it's very likely that it's a bug in Vue CLI. And likely caused by this line:

this._registry = (await execa(this.bin, ['config', 'get', 'registry'])).stdout

Maybe the output yarn config get registry contains some non-printing unicode characters under this specific execution environment.

@jacekkarczmarczyk
Copy link
Author

jacekkarczmarczyk commented Aug 19, 2020

Actually I'm using git-bash, I've just checked with cygwin (and with Window PowerShell) and it's working fine, so must be a git-bash related issue

Also the non-printing chars is a good lead, I did

yarn config get registry > test.txt

and got

�[2K�[1Ghttps://registry.yarnpkg.com

or as json:

"\u001b[2K\u001b[1Ghttps://registry.yarnpkg.com"

haoqunjiang added a commit to haoqunjiang/vue-cli that referenced this issue Aug 21, 2020
To deal with malformed stdout result retrieved from child processes.

Fixes vuejs#5802
haoqunjiang added a commit that referenced this issue Aug 24, 2020
To deal with malformed stdout result retrieved from child processes.

Fixes #5802
@jacekkarczmarczyk
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants