Vue cli ошибка при установке

This document covers some common Vue CLI issues and how to resolve them. You should always follow these steps before opening a new issue.

Running installation with sudo or as root

If you install @vue/cli-service as root user or with sudo, there might be issues when running package postinstall scripts.

This is a security feature of npm. You should always avoid running npm with root privileges because install scripts can be unintentionally malicious.

If you must however, you can workaround this error by setting the --unsafe-perm flag of npm. This can be done by prefixing the command with an environment variable, i.e.

npm_config_unsafe_perm=true vue create my-project

Symbolic Links in node_modules

If there’re dependencies installed by npm link or yarn link, ESLint (and sometimes Babel as well) may not work properly for those symlinked dependencies. It is because webpack resolves symlinks to their real locations by default, thus breaks ESLint / Babel config lookup.

A workaround for this issue is to manually disable symlinks resolution in webpack:

// vue.config.js
module.exports = {
  chainWebpack: (config) => {
    config.resolve.symlinks(false)
  }
}

WARNING

Disabling resolve.symlinks may break hot module reloading if your dependencies are installed by third-party npm clients that utilized symbolic links, such ascnpm or pnpm.

I’m trying to install Vue-cli environemnt via NPM.

npm install --global vue-cli

After that I want to create project

vue init webpack my-project

And I get an error

'vue' is not recognized as an internal or external command,
operable program or batch file.

I’ve read some solutions, most of them concern changing

PATH to C:Users{YourUser}AppDataRoamingnpm

Didn’t work for me. Can anyone help.

asked May 15, 2017 at 16:25

ogostos's user avatar

6

I follow these commands, It’s work fine for me.

npm install -g vue-cli

npm install -g vue

Edit the System environment variables, and enter the following path, and if still having a problem just try to add a path in System User Variables

C:Program Filesnodejsnode.exe;

C:Users{UserName}AppDataRoamingnpm

Check vue installed in C:Users{UserName}AppDataRoamingnpm
enter image description here

Image 1

Image 2

Image 3

answered Oct 16, 2019 at 7:41

sarath kumar's user avatar

sarath kumarsarath kumar

1,26510 silver badges6 bronze badges

1

yarn add @vue/cli-service

or

npm install @vue/cli-service

is what worked for me

AS Mackay's user avatar

AS Mackay

2,8319 gold badges19 silver badges25 bronze badges

answered Jul 27, 2019 at 6:29

Bruce Cesar's user avatar

Well, problem was solved by simply deleting everything related to vue-cli installed before. And re-installing vue-cli.

answered May 25, 2017 at 19:25

ogostos's user avatar

ogostosogostos

1,4252 gold badges20 silver badges29 bronze badges

1

I have faced simillar issue and re-installing vue-cli didn’t work for me. Strange thing is vue and vue-cli get installed successfully but once I tried to create project by using below command

vue init webpack myfirstproject

I get below error:

'vue' is not recognized as an internal or external command,operable program or batch file.

Tried various solutions but nothing worked for me. Please find my NPM and Node details below:

NPM version: 6.2.0
Node version: 8.7.0

Actually the issue was «vue-cli» is not supporting to my Node(8.7.0). It requires Node >=8.9. Once I upgraded my Node version. everything is working fine.

upgrading your Node version is the correct way to deal with this issue

answered Jul 24, 2018 at 14:11

Sandy.....'s user avatar

Sandy…..Sandy…..

2,8132 gold badges15 silver badges26 bronze badges

I found this same issue with another possible problem. I had

create-react-app@1.5.2 installed globally

npm list -g —depth=0 will display your globals

I simply uninstalled create-react-app

npm uninstall create-react-app

Vue vue-cli-service now works as expected.

answered Jun 1, 2019 at 13:17

Greg Funston's user avatar

had the same issue, i deleted my node_modules and re-install and it worked

answered Aug 21, 2019 at 11:53

Koko's user avatar

KokoKoko

311 silver badge5 bronze badges

I had the same problem after searching a lot I found this solution:

You need to Add C:Program Filesnodejs to your PATH environment variable. To do this follow these steps:

  1. Use the global Search to go to «Environment Variables»
  2. Click «Edit system environment variables»
  3. Click «Environment Variables» in the dialog
  4. In the «System Variables» box, search for Path and edit it to include C:Program Filesnodejs.

You will have to restart any currently-opened command prompts before it will take effect.

I hope it works, good luck!

answered Sep 4, 2019 at 9:33

Diego's user avatar

DiegoDiego

112 bronze badges

I was installing @vue/cli using yarn, i.e. I ran

yarn global add @vue/cli

Calling vue on windows did not work after the installation (‘vue’ is not recognized as an internal or external command)

What I needed to do was to add C:Users<MY USERNAME>AppDataLocalYarnbin to path.

answered Dec 27, 2020 at 16:52

David Vonka's user avatar

David VonkaDavid Vonka

5114 silver badges14 bronze badges

yarn global add @vue/cli did not work for me

So I removed using yarn global remove @vue/cli

Then I installed using npm install -g @vue/cli and its working fine.

answered Mar 23, 2021 at 3:24

Alok's user avatar

AlokAlok

7,3447 gold badges53 silver badges94 bronze badges

1)Try to remove all the node files, npm and nvm files/folders.

2)Also, remove the PATH of node js and nvm from environment variables.

3)try commands:

   node -v
   npm -v
   nvm -v

above commands only to make sure that all the entities related to node are uninstalled.
4) install node, and if necessary install nvm(optioal), then run command

   npm install -g @vue/cli

above procedure proven to be useful for me. Just give it a try!

answered Jan 14, 2020 at 4:51

Aryesh's user avatar

AryeshAryesh

3662 silver badges16 bronze badges

for Yarn -> need to install it:

npm install -g yarn

Installing Vue CLI Package:

yarn global add @vue/cli

To create project:

vue create project-name

To run:

yarn serve

Uninstalling:

yarn global remove @vue/cli

I follow «npm» package manager instead of «yarn» package manager console because yarn give me a problem while installing it;

command to install Vue CLI:

npm install -g @vue/cli

For to create Vue project:

vue create "project-name"

For to run Vue project:

npm run serve

Phil Dukhov's user avatar

Phil Dukhov

63.6k14 gold badges166 silver badges199 bronze badges

answered Feb 19, 2022 at 6:54

Ganesh Gavhane's user avatar

Странно, но я почему-то не могу установить vue-cli. Терминал выдает ошибку

PS C:UsersSkwoDesktopvue.new.project> npm i @vue/cli
Нераспознанный токен в исходном тексте.
строка:1 знак:7
+ npm i  <<<< @vue/cli
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnrecognizedToken
 
PS C:UsersSkwoDesktopvue.new.project> npm install -g @vue/cli
Нераспознанный токен в исходном тексте.
строка:1 знак:16
+ npm install -g  <<<< @vue/cli
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnrecognizedToken

Такие ответы на разные попытки.
Проверил установлены ли глобально пакеты, может нужно переустановить.
Никаких пакетов Vue не обнаружил..

@Tsaukpaetra

Version

5.0.1

Reproduction link

[None](Can’t create a project, thus there is no code to reproduce)

Environment info

Unable to comply, vue-cli doesn't get installed.
Running Windows 11 22000.527 (21H2)

Steps to reproduce

C:>yarn global add @vue/cli
yarn global v1.22.15
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "@vue/cli@5.0.1" with binaries:
      - vue
Done in 4.92s.

C:>vue ui
'vue' is not recognized as an internal or external command,
operable program or batch file.

C:>where vue
INFO: Could not find files for the given pattern(s).

C:>

What is expected?

Installing Vue-cli

What is actually happening?

Things apparently get installed, but… aren’t?


This is a clean Windows 11 install, installed node-v16.14.0-x64, enabled Yarn via corepack enable and then attempted to install Vue ui.
I’m not sure where I went wrong, things have apparently changed since I last worked with this early 2020, so maybe I’m not following instructions correctly.

@YFengFly

I think it’s a matter of environment variables: environment variables may not be automatically configured when yarn is installed.
I recommend that you reinstall yarn as an administrator, or add environment variable for yarn.

@Tsaukpaetra

I’m not sure how environment variables come into play. Since I can run the yarn command, that’s clearly already been handled, has it not? As far as I remember the documentation mentioning, you just need the path for it added and Bob’s your uncle.

Why should I be required to faff about with environment variables anyways? This should have been a solved problem since Windows NT…

@LinusBorg

I’m not sure how environment variables come into play. Since I can run the yarn command, that’s clearly already been handled, has it not?

Not necessarily. yarn will put the global package some place, and then add a symlink in a location that has to be within your terminal’s PATH (that how it’s on OSX at least).

That yarn can be run doesn’t mean that whatever you install globally with it is also within the PATH of your terminal. Not having any experience with yarn on windows I can’t provide you any further hints beyond that.

This is not something we can influence within this project, it’s a problem of configuration with your machine: it’s not about @vue/cli, it’s about how the tool you use to install @vue/cli makes it executable — or fails to do so on your machine.

I have installed the latest version of npm and with that, I am trying to install vue-cli using the command

npm install --global vue-cli

But I am running into issues stated below:

    npm ERR! code EPROTO
npm ERR! errno EPROTO
npm ERR! request to http://registry.npmjs.org/vue-cli failed, reason: write EPROTO 101057795:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:opensslssls23_clnt.c:827:
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     C:Userspd0ufvAppDataRoamingnpm-cache_logs2018-02-02T17_02_16_113Z-debug.log

I have set my proxy setting as well using

npm set http-proxy <proxy>

npm set https-proxy <proxy>

but didn’t work as well. I am using npm version 5.6.0.

  • Vts ошибка а50 motsup
  • Vts optima коды ошибок
  • Vtosters не работает музыка ошибка
  • Vtm 4 honda pilot ошибка
  • Vtc world ошибка приложения 0xc000007b