vue-cli: vue upgrade command asks for a plugin and doesn't recognize when it is installed
Version
3.2.1
Environment info
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
Binaries:
Node: Not Found
Yarn: Not Found
npm: 6.2.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 44.17763.1.0
npmGlobalPackages:
@vue/cli: Not Found
Note that Node is absolutely installed. "node -v" reports 10.9.0.
Steps to reproduce
- run “vue upgrade”
- It reports:
Command vue upgrade requires a global addon to be installed. Please run npm install -g @vue/cli-upgrade and try again.
- I run the above command, close the terminal, open a new one, and try it again. Same issue.
What is expected?
For it to attempt to update my CLI.
What is actually happening?
It reports what is shown in figure 3.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18
Commits related to this issue
- fix: add missing dependencies to @vue/cli-upgrade fixes #3417 fixes #3222 — committed to sodatea/vue-cli by sodatea 5 years ago
- fix: add missing dependencies to @vue/cli-upgrade (#4036) fixes #3417 fixes #3222 — committed to vuejs/vue-cli by sodatea 5 years ago
If we execute commands:
and get the following result:
Now we open
%AppData%\npm\node_modules\@vue\cli\lib\util\loadCommand.js, navigate to line 11catch (err2), addconsole.log(err2), runVue upgrade, get the following results:However, we can find the
@vue/cli-shared-utilsmodule in the%AppData%\Roaming\npm\node_modules\@vue\cli\node_modules\@vue\directory.Now let’s execute commands:
and get the following result:
But one thing that puzzles me is: The expected result could not be obtained yesterday through the following command
I have to use the separate
yarninstaller to installyarnand then execute other commands. But today there is no problem.npm i @vue/cli @vue/cli-upgrade -gworked for me (Node 12)