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
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
answered Oct 16, 2019 at 7:41
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
2,8319 gold badges19 silver badges25 bronze badges
answered Jul 27, 2019 at 6:29
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
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…..Sandy…..
2,7932 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
had the same issue, i deleted my node_modules and re-install and it worked
answered Aug 21, 2019 at 11:53
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:
- Use the global Search to go to «Environment Variables»
- Click «Edit system environment variables»
- Click «Environment Variables» in the dialog
- 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
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 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
AlokAlok
7,2947 gold badges53 silver badges93 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
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
62.9k13 gold badges163 silver badges198 bronze badges
answered Feb 19, 2022 at 6:54
Странно, но я почему-то не могу установить 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 не обнаружил..
Version
3.0.1
Reproduction link
http://nolink
Node and OS info
Node v8.11.4 / Windows 7
Steps to reproduce
npm install -g @vue/cli
What is expected?
Successful install
What is actually happening?
Error: EPERM: operation not permitted, rename
tried running as admin but still same error
end lines from log
8917 verbose unlock done using C:UserspkumarAppDataRoamingnpm-cache_locksstaging-64e07ed02ac4e2e4.lock for C:UserspkumarAppDataRoamingnpmnode_modules.staging
8918 verbose stack Error: EPERM: operation not permitted, rename ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json.189012702’ -> ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json’
8919 verbose cwd C:UserspkumarworkspaceNodeJsVUEvue-cli3
8920 verbose Windows_NT 6.1.7601
8921 verbose argv «C:Program Files (x86)nodejsnode.exe» «C:Program Files (x86)nodejsnode_modulesnpmbinnpm-cli.js» «install» «-g» «@vue/cli»
8922 verbose node v8.11.4
8923 verbose npm v5.6.0
8924 error path C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json.189012702
8925 error code EPERM
8926 error errno -4048
8927 error syscall rename
8928 error Error: EPERM: operation not permitted, rename ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json.189012702’ -> ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json’
8928 error { Error: EPERM: operation not permitted, rename ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json.189012702’ -> ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json’
8928 error cause:
8928 error { Error: EPERM: operation not permitted, rename ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json.189012702’ -> ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json’
8928 error errno: -4048,
8928 error code: ‘EPERM’,
8928 error syscall: ‘rename’,
8928 error path: ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json.189012702’,
8928 error dest: ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json’ },
8928 error stack: ‘Error: EPERM: operation not permitted, rename ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json.189012702’ -> ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json»,
8928 error errno: -4048,
8928 error code: ‘EPERM’,
8928 error syscall: ‘rename’,
8928 error path: ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json.189012702’,
8928 error dest: ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json’ }
8929 error Please try running this command again as root/Administrator.
8930 verbose exit [ -4048, true ]
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.
Когда я ввожу команду vue, то оно пишет, что такой команды нет. При этом когда я просматриваю пакеты, которые у меня установлены, то cli там есть) В итоге у меня не получилось с ним ничего, и я установил vue через команду «npm init vue@latest». Я так понял, что это что-то немного другое, но всё получилось, и приложение запускается на 3000 сервере
Добавлено через 2 минуты
Когда я ввожу команду vue, то оно пишет, что такой команды нет, точнее вот это пишет:
Код
PS C:Usersadminmyproject> vue --version vue : Не удается загрузить файл C:UsersadminAppDataRoamingnpmvue.ps1. Файл C:UsersadminAppDataRoamingnpmvue.ps1 не имеет цифровой подписи. Невозможно выполнить сценарий в указанной системе. Для получения дополнительных сведений о выполнении сценариев и н астройке политики выполнения см. about_Execution_Policies по адресу https:/go.microsoft.com/fwlink/?LinkID=135170. строка:1 знак:1 + vue --version + ~~~ + CategoryInfo : Ошибка безопасности: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess PS C:Usersadminmyproject>
И при этом, когда я просматриваю пакеты, которые у меня установлены, то cli там есть) В итоге у меня не получилось с ним ничего, и я установил vue через команду «npm init vue@latest». Я так понял, что это что-то немного другое, но всё получилось, и приложение запускается на 3000 сервере
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
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
answered Oct 16, 2019 at 7:41
sarath kumarsarath kumar
1,22510 silver badges6 bronze badges
1
yarn add @vue/cli-service
or
npm install @vue/cli-service
is what worked for me
AS Mackay
2,8119 gold badges18 silver badges25 bronze badges
answered Jul 27, 2019 at 6:29
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
ogostosogostos
1,4252 gold badges18 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…..Sandy…..
2,7752 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
had the same issue, i deleted my node_modules and re-install and it worked
answered Aug 21, 2019 at 11:53
KokoKoko
312 silver badges5 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:
- Use the global Search to go to «Environment Variables»
- Click «Edit system environment variables»
- Click «Environment Variables» in the dialog
- 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
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 VonkaDavid Vonka
5013 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
AlokAlok
6,9576 gold badges46 silver badges85 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
AryeshAryesh
3362 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
54.8k12 gold badges118 silver badges159 bronze badges
answered Feb 19, 2022 at 6:54
Version
3.0.1
Reproduction link
http://nolink
Node and OS info
Node v8.11.4 / Windows 7
Steps to reproduce
npm install -g @vue/cli
What is expected?
Successful install
What is actually happening?
Error: EPERM: operation not permitted, rename
tried running as admin but still same error
end lines from log
8917 verbose unlock done using C:UserspkumarAppDataRoamingnpm-cache_locksstaging-64e07ed02ac4e2e4.lock for C:UserspkumarAppDataRoamingnpmnode_modules.staging
8918 verbose stack Error: EPERM: operation not permitted, rename ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json.189012702’ -> ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json’
8919 verbose cwd C:UserspkumarworkspaceNodeJsVUEvue-cli3
8920 verbose Windows_NT 6.1.7601
8921 verbose argv «C:Program Files (x86)nodejsnode.exe» «C:Program Files (x86)nodejsnode_modulesnpmbinnpm-cli.js» «install» «-g» «@vue/cli»
8922 verbose node v8.11.4
8923 verbose npm v5.6.0
8924 error path C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json.189012702
8925 error code EPERM
8926 error errno -4048
8927 error syscall rename
8928 error Error: EPERM: operation not permitted, rename ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json.189012702’ -> ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json’
8928 error { Error: EPERM: operation not permitted, rename ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json.189012702’ -> ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json’
8928 error cause:
8928 error { Error: EPERM: operation not permitted, rename ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json.189012702’ -> ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json’
8928 error errno: -4048,
8928 error code: ‘EPERM’,
8928 error syscall: ‘rename’,
8928 error path: ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json.189012702’,
8928 error dest: ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json’ },
8928 error stack: ‘Error: EPERM: operation not permitted, rename ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json.189012702’ -> ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json»,
8928 error errno: -4048,
8928 error code: ‘EPERM’,
8928 error syscall: ‘rename’,
8928 error path: ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json.189012702’,
8928 error dest: ‘C:UserspkumarAppDataRoamingnpmnode_modulesrimrafpackage.json’ }
8929 error Please try running this command again as root/Administrator.
8930 verbose exit [ -4048, true ]
I’m trying to install VueJS CLI on my Windows 10 machine but ran into the errors below:
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/joi@15.1.1: This version has been deprecated and is no longer supported or maintained
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
Here’s my PC setup:
Windows 10
Node: v12.18.2
Npm: 6.14.5
asked Jul 12, 2020 at 7:08
1
I also had many unresolved warning including @hapi/hoek
and @hapi/topo
. I was able to resolve all of them by running
npm audit fix --force
And of course I do understand, that it doesn’t cover the 100% of cases.
answered Dec 18, 2021 at 10:30
Dzmitry AliferDzmitry Alifer
3891 gold badge5 silver badges16 bronze badges
Installing Vue Cli
npm install -g @vue/cli
OR
yarn global add @vue/cli
For further detail, visit the Installation Guide enter link description here
answered Jul 20, 2020 at 22:13
2
I’m trying to install VueJS CLI on my Windows 10 machine but ran into the errors below:
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/joi@15.1.1: This version has been deprecated and is no longer supported or maintained
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
Here’s my PC setup:
Windows 10
Node: v12.18.2
Npm: 6.14.5
asked Jul 12, 2020 at 7:08
1
I also had many unresolved warning including @hapi/hoek
and @hapi/topo
. I was able to resolve all of them by running
npm audit fix --force
And of course I do understand, that it doesn’t cover the 100% of cases.
answered Dec 18, 2021 at 10:30
Dzmitry AliferDzmitry Alifer
3891 gold badge5 silver badges16 bronze badges
Installing Vue Cli
npm install -g @vue/cli
OR
yarn global add @vue/cli
For further detail, visit the Installation Guide enter link description here
answered Jul 20, 2020 at 22:13
2
Когда я ввожу команду vue, то оно пишет, что такой команды нет. При этом когда я просматриваю пакеты, которые у меня установлены, то cli там есть) В итоге у меня не получилось с ним ничего, и я установил vue через команду «npm init vue@latest». Я так понял, что это что-то немного другое, но всё получилось, и приложение запускается на 3000 сервере
Добавлено через 2 минуты
Когда я ввожу команду vue, то оно пишет, что такой команды нет, точнее вот это пишет:
Код
PS C:Usersadminmyproject> vue --version vue : Не удается загрузить файл C:UsersadminAppDataRoamingnpmvue.ps1. Файл C:UsersadminAppDataRoamingnpmvue.ps1 не имеет цифровой подписи. Невозможно выполнить сценарий в указанной системе. Для получения дополнительных сведений о выполнении сценариев и н астройке политики выполнения см. about_Execution_Policies по адресу https:/go.microsoft.com/fwlink/?LinkID=135170. строка:1 знак:1 + vue --version + ~~~ + CategoryInfo : Ошибка безопасности: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess PS C:Usersadminmyproject>
И при этом, когда я просматриваю пакеты, которые у меня установлены, то cli там есть) В итоге у меня не получилось с ним ничего, и я установил vue через команду «npm init vue@latest». Я так понял, что это что-то немного другое, но всё получилось, и приложение запускается на 3000 сервере
Справочные статьи:https://www.jianshu.com/p/bfa29d371cc8
Планирую использовать недавноvue-cli
Напишите проект и найдите способ установки, указанный на официальном сайтеnpm install @vue/cli -g
Почему не удается установить, сообщается о следующей ошибке
EPERM: operation not permitted, rename 'C:UsersxxxAppDataRoamingnpmnode_modules
@vueclinode_modulesabbrevpackage.json.352729074'
-> 'C:UsersxxxAppDataRoamingnpmnode_modules@vueclinode_modulesabbrevpackage.json'
Позже выяснилось, что дажеvue -V
Мегаполисvue - это не внутренняя команда
Ошибка, думая, что это может быть проблема с vue.
Я проверил бесчисленное количество информации в блогах в Интернете и наконец решил свою проблему. (Система Win10)
Ситуация у всех может быть разной, просто для справки.
Первый шаг: настроить путь (уже настроенный можно пропустить)
npm config get prefix
Скопируйте полученную информацию о пути и перейдите вРабочий стол> Щелкните правой кнопкой мыши на компьютере> Свойства> Расширенные настройки системы> Переменные среды
вСистемная переменнаяНовая переменная вNPM
, Значение переменной — это информация о пути, скопированная ранее, обычноC:UsersxxxAppDataRoamingnpm
снова вСистемная переменнаяНайти вpath
,Добавить в%NPM%
. Продолжайте нажимать «Сохранить».
Шаг 2. Установите cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
Шаг третий (самый ответственный!)
npm i npm -g
npm i @ vue / cli -g // Неважно, если вы по-прежнему сообщаете об ошибке, продолжайте выполнять следующую команду
cnpm i @vue/cli -g
появитьсяAll packages installed (used 6ms(network 2ms), speed 0B/s, json 0(0B), tarball 0B)
Это успех!
можно использоватьvue -V
Попробуйте, обычная информация о версии — идеальный успех!
I’m trying to upgrade to vue cli 3.
But when I do npm install -g @vue/cli
,
I get:
npm ERR! path C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json.3031334961
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json.3031334961' -> 'C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json'
npm ERR! { Error: EPERM: operation not permitted, rename 'C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json.3031334961' -> 'C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json'
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, rename 'C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json.3031334961' -> 'C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json.3031334961',
npm ERR! dest: 'C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json' },
npm ERR! stack: 'Error: EPERM: operation not permitted, rename 'C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json.3031334961' -> 'C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json.3031334961',
npm ERR! dest: 'C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersnewsoeAppDataRoamingnpm-cache_logs2018-07-31T16_20_47_847Z-debug.log
I have tried running it in cmd as administrator and in git bash as administrator, and I have uninstalled the old vue-cli. Any thoughts?
I’m trying to upgrade to vue cli 3.
But when I do npm install -g @vue/cli
,
I get:
npm ERR! path C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json.3031334961 npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall rename npm ERR! Error: EPERM: operation not permitted, rename 'C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json.3031334961' -> 'C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json' npm ERR! { Error: EPERM: operation not permitted, rename 'C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json.3031334961' -> 'C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json' npm ERR! cause: npm ERR! { Error: EPERM: operation not permitted, rename 'C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json.3031334961' -> 'C:UsersnewsoeAppDataRoamingnpmnode_modules@vueclipackage.json' npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'rename', npm ERR! path: 'C:\Users\newsoe\AppData\Roaming\npm\node_modules\@vue\cli\package.json.3031334961', npm ERR! dest: 'C:\Users\newsoe\AppData\Roaming\npm\node_modules\@vue\cli\package.json' }, npm ERR! stack: 'Error: EPERM: operation not permitted, rename 'C:\Users\newsoe\AppData\Roaming\npm\node_modules\@vue\cli\package.json.3031334961' -> 'C:\Users\newsoe\AppData\Roaming\npm\node_modules\@vue\cli\package.json'', npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'rename', npm ERR! path: 'C:\Users\newsoe\AppData\Roaming\npm\node_modules\@vue\cli\package.json.3031334961', npm ERR! dest: 'C:\Users\newsoe\AppData\Roaming\npm\node_modules\@vue\cli\package.json' } npm ERR! npm ERR! Please try running this command again as root/Administrator. npm ERR! A complete log of this run can be found in: npm ERR! C:UsersnewsoeAppDataRoamingnpm-cache_logs2018-07-31T16_20_47_847Z-debug.log
I have tried running it in cmd as administrator and in git bash as administrator, and I have uninstalled the old vue-cli. Any thoughts?