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 not create project by vue-cli #3076

Closed
nqdai1992 opened this issue Dec 4, 2018 · 14 comments
Closed

Can not create project by vue-cli #3076

nqdai1992 opened this issue Dec 4, 2018 · 14 comments

Comments

@nqdai1992
Copy link

Version

3.2.1

Environment info

System:
    OS: macOS 10.14.1
    CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz
  Binaries:
    Node: 10.9.0 - ~/.nvm/versions/node/v10.9.0/bin/node
    Yarn: Not Found
    npm: 6.2.0 - ~/.nvm/versions/node/v10.9.0/bin/npm
  Browsers:
    Chrome: 70.0.3538.110
    Firefox: 63.0.3
    Safari: 12.0.1
  npmGlobalPackages:
    @vue/cli: 3.2.1

Steps to reproduce

Run command "vue create my-app"

What is expected?

Create new project

What is actually happening?

Command "vue create" is not working

@haoqunjiang
Copy link
Member

What options did you choose? Any error messages?

@haoqunjiang haoqunjiang added the needs reproduction This issue is missing a minimal runnable reproduction, provided by the author label Dec 4, 2018
@nqdai1992
Copy link
Author

What options did you choose? Any error messages?

I don't use any option. I just use "vue create my-app"

@haoqunjiang
Copy link
Member

So what do you mean by "not working"? There should be an error message. Otherwise checkboxes would be displayed for you to choose.

@nqdai1992
Copy link
Author

So what do you mean by "not working"? There should be an error message. Otherwise checkboxes would be displayed for you to choose.

There is not show any things on my screen, no error message, no checkbox. I've wait 2 hours and my screen is not changed

@haoqunjiang
Copy link
Member

Which terminal emulator did you use?
Non-interactive shells may fail to run vue create.
There's also a warning in our documentation:

If you are on Windows using Git Bash with minTTY, the interactive prompts will not work. You must launch the command as winpty vue.cmd create hello-world.
If you however want to still use the vue create hello-world syntax, you can alias the command by adding the following line to your ~/.bashrc file.
alias vue='winpty vue.cmd'
You will need to restart your Git Bash terminal session to pull in the updated bashrc file.

@haoqunjiang
Copy link
Member

Just figured it out.
You must be stuck by the getVersions logic:

const { current, latest } = await getVersions()

Check the ~/.vuerc file and toggle its useTaobaoRegistry field.

It's either because @vue/cli failed to fetch https://registry.npmjs.com/vue-cli-version-marker/latest or it failed to get https://registry.npm.taobao.org/vue-cli-version-marker/latest. Toggle useTaobaoRegistry and it will try to use the other registry url.

@LinusBorg LinusBorg added enhancement scope: cli and removed needs reproduction This issue is missing a minimal runnable reproduction, provided by the author labels Jan 10, 2019
@LinusBorg
Copy link
Member

@sodatea Is there something left to do? It was added to the Jan update, then removed, and util I removed it, it stil have the "needs repro" flag.

Do you intend to make a change or something?

@haoqunjiang
Copy link
Member

@LinusBorg I planned to add a timeout for all network requests in the creator, which will make such problems easier to identify.
In the “January Update” project I only changed the issue card to a reference with a few notes... don’t know why github thought I was removing it.

@againF
Copy link

againF commented Jan 11, 2019

我遇到了相同的问题,很高兴在这里找到了解决方法,但是当我试图去修改文件vuerc时,我发现我找不到这个文件,我在我的计算机里全局搜索了,没有这个文件,我现在输入vue -V可以打印出2.9.1,我输入vue,打印结果是

Usage: vue [options]

Options:

-V, --version  output the version number
-h, --help     output usage information

Commands:

init        generate a new project from a template
list        list available official templates
build       prototype a new project
help [cmd]  display help for [cmd]

vue/cli的版本是3.3.0

@haoqunjiang
Copy link
Member

@againF 可能你系统路径里仍然有 vue-cli 2.x,请先运行 npm uninstall -g vue-cli。另外好像 nvm 可能存在无法彻底删除某个全局包的问题,如果仍然运行上述命令后仍然无法解决的话请彻底卸载 nvm 再重装试试。

@againF
Copy link

againF commented Jan 11, 2019

@sodatea 非常感谢,是我的问题,vue很棒,我修改过npm安装的全局路径,但是环境变量没有正确配置,修改环境变量后,问题解决了。你及时的解答提醒了我,非常感谢。

@haidery786
Copy link

haidery786 commented Jan 25, 2020

image

I have got nodejs 12.14.1 version and npm 4.1.2 version. I have windows 10 machine. I installed vue version 4.1.2 but couldn't create project through vue create hello-world e.g. I have attached the screenshot. Please help me. It is just not working on my laptop.

@haoqunjiang
Copy link
Member

@haidery786 Try running vue config --set useTaobaoRegistry false first.
Seems that on the first run, the CLI incorrectly inferred that your connection to registry.npm.taobao.org is faster than registry.npmjs.org and set that flag, but in reality, the connection to the taobao registry is so slow that the installation stalls.

@haidery786
Copy link

haidery786 commented Jan 26, 2020

Hey @sodatea
That did work for me. Thanks a lot😊

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

No branches or pull requests

5 participants