vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.76k stars 6.33k forks source link

can't be installed on latest windows 10 and can't initiale a new project #5840

Open mrhili opened 4 years ago

mrhili commented 4 years ago

Version

4.5.4

Reproduction link

http://no-url.com/link-not/ok?

Environment info

windows 10 home
version : 1903
build :1832.1016

Steps to reproduce

http://no-url.com/link-not/ok?

What is expected?

http://no-url.com/link-not/ok?

What is actually happening?

i cannot install vue cli in windows 10


npm i -g @vue/cli @vue/cli-service-global npm WARN deprecated @hapi/joi@15.1.1: joi is leaving the @hapi organization and moving back to 'joi' (https://github.com/sideway/joi/issues/2411) npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated @hapi/address@2.1.4: This version has been deprecated and is no longer supported or maintained npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm ERR! Unexpected end of JSON input while parsing near '...^1.16.31","@types/web'

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\HP\AppData\Roaming\npm-cache_logs\2020-09-01T15_33_15_167Z-debug.log


if i install vue like : npm i -g vue installed succefully but cant initiat a new a project

haoqunjiang commented 4 years ago

Looks like a network issue related to the npm registry. Please check your network and try again.

mrhili commented 4 years ago

Checked many times

24 houre of trying

mrhili commented 4 years ago

maybe antivirus ? i will see

mrhili commented 4 years ago

Vue CLI v3.8.4 ✨ Creating project in C:\laragon\www\learning-projects\crashcourse. � Initializing git repository... ⚙ Installing CLI plugins. This might take a while...

npm ERR! Unexpected end of JSON input while parsing near '...ed-require":"0.2.x","'

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\HP\AppData\Roaming\npm-cache_logs\2020-09-01T19_50_58_244Z-debug.log ERROR command failed: npm install --loglevel error --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao.org/dist

haoqunjiang commented 4 years ago

For the second error, run

vue config --set useTaobaoRegistry false

and try again.

BTW you are using a very old version of @vue/cli, it's recommended to upgrade to the latest v4.5

mrhili commented 4 years ago

Not working even with this configuration

haoqunjiang commented 4 years ago

If the error message still says "npm ERR! Unexpected end of JSON input while parsing near" then it's clearly a network/npm issue. In that case, there's nothing more I can help you with.

geni94 commented 4 years ago

I'm having this issue as well.

Specs: Windows 10 Node 14.8.0 Yarn 1.22.5

Running vue init [params] throws the following error:

Command vue init requires a global addon to be installed.
Please run yarn global add @vue/cli-init and try again.

Installing @vue/cli-init separately didn't solve the issue. Any clue?

haoqunjiang commented 4 years ago

@geni94 Maybe npm install -g @vue/cli-init?

geni94 commented 4 years ago

@geni94 Maybe npm install -g @vue/cli-init?

That didn't help either: it kept throwing the error.

Apparently using yarn was causing the issue, although I'm still not sure why. Uninstalling everything and then installing again with npm fixed the issue for me, although I wanted to use yarn and not npm.

mrhili commented 4 years ago

I will try and give you afeedback

mrhili commented 4 years ago

PS C:\Users\HP> npm install -g vue

vue@2.6.12 added 1 package from 1 contributor in 33.477s

smilingkite commented 4 years ago

For what it's worth: I was unable to use gitBash (even with administrator-rights) to start a vue-cli project, but the command prompt worked like a charm.

felix-cao commented 3 years ago

yarn cache clean yarn global add @vue-cli

More