3.2.1
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.
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.
For it to attempt to update my CLI.
It reports what is shown in figure 3.
Upgraded to 3.2.2, same result.
Because the official is not ready for the vue upgrade package.
If so then it is still a valid bug - the help text for the CLI should be updated to remove this until it's ready, right?
If you use the standalone installer to install yarn and then yarn global add @vue/cli @vue/cli-upgrade, you can use the vue upgrade command.
If yarn is installed via npm, then npm i @vue/cli @vue/cli-upgrade -g, the vue upgrade command will throw an error and cannot be used.
If yarn is installed via npm, then yarn global add @vue/cli @vue/cli-upgrade, the system does not recognize the vue related command and cannot be used.
I honestly have no idea what you are saying here. :) I installed the CLI via npm. I installed cli-upgrade via npm as well. I did not use Yarn at all.
If you look at the code for @vue/cli-upgrade, you'll see that it detects if it's in the yarn environment.
So, you must install yarn independently, this is required, then you must use the yarn global add @vue/cli @vue/cli-upgrade command to install @vue/cli and @vue/cli-upgrade.
Where do the docs say that Yarn is required? Heck, the docs show both npm and yarn, and npm is shown first.
If we execute commands:
npm i @vue/cli @vue/cli-upgrade
vue upgrade
and get the following result:
Command
vue upgraderequires a global addon to be installed.
Please runyarn global add @vue/cli-upgradeand try again.
Now we open %AppData%\npm\node_modules\@vue\cli\lib\util\loadCommand.js, navigate to line 11 catch (err2), add console.log(err2), run Vue upgrade, get the following results:
Error: Cannot find module '@vue/cli-shared-utils'
However, we can find the @vue/cli-shared-utils module in the %AppData%\Roaming\npm\node_modules\@vue\cli\node_modules\@vue\ directory.
Now let's execute commands:
npm uninstall @vue/cli @vue/cli-upgrade -g
yarn global add @vue/cli @vue/cli-upgrade
vue upgrade
and get the following result:
✔ Gathering update information...
Already up-to-date.
But one thing that puzzles me is:
The expected result could not be obtained yesterday through the following command
npm i yarn -g
yarn global add @vue/cli @vue/cli-upgrade
vue upgrade
I have to use the separate yarn installer to install yarn and then execute other commands.
But today there is no problem.
Update:
Today I can't use the following command:
npm i yarn -g
yarn global add @vue/cli @vue/cli-upgrade
vue --version
- vue --version
- ~~~
+ CategoryInfo : ObjectNotFound: (vue:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I'm having similar issues:
npm i -g @vue/cli @vue/cli-upgrade
asks me to npm install -g @vue/clu-upgrade or, should I install yarn yarn add global @vue/cli-upgrade. Havent tried forcing yarn yet, but this should not be.
OS: Kubuntu 18.04
npm: 5.6
node: 8.12.0
@CaiPeng1989: Yes, it does detect if your in a yarn environment (or more precise, if you have yarn installed), but only to output the _correct_ error message: either npm install or yarn add. I actually dont see any other _use_ of yarn in lib/utils/loadCommand.js . As per the CommandNotFoundException, yarn global bin needs to be in the $PATH, had the same issue just now. (see here)
Upgraded node & npm and all is well. Works with: npm: 6.4.1 & node: 10.15.0.
当我使用 vue upgrade 指令,等会会输出
✔ Gathering update information...
Already up-to-date.
但是没有什么效果,package.json 依赖项不变,怎么回事?
@gauseen 有可能是yarn.lock里面的版本已经是最新的了
@CaiPeng1989
$ vue info
Environment Info:
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.6
Binaries:
Node: 10.13.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.12.3 - C:\Program Files (x86)\Yarn\bin\ya
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 41.16299.820.0
npmPackages:
@vue/babel-preset-app: 3.0.4
@vue/cli-overlay: 3.0.4
@vue/cli-plugin-babel: ^3.0.4 => 3.0.4
@vue/cli-plugin-eslint: ^3.0.4 => 3.0.4
@vue/cli-plugin-unit-mocha: ^3.0.4 => 3.0.4
@vue/cli-service: ^3.0.4 => 3.0.4
@vue/cli-shared-utils: 3.0.4
@vue/component-compiler-utils: 2.2.0
@vue/eslint-config-standard: ^3.0.4 => 3.0.4
@vue/preload-webpack-plugin: 1.1.0
@vue/test-utils: ^1.0.0-beta.20 => 1.0.0-beta.25
@vue/web-component-wrapper: 1.2.0
babel-helper-vue-jsx-merge-props: 2.0.3
babel-plugin-transform-vue-jsx: 4.0.1
eslint-plugin-vue: 4.7.1
vue: ^2.5.17 => 2.5.17
vue-cli-plugin-custom-config: ^0.0.3 => 0.0.3
vue-eslint-parser: 2.0.3
vue-hot-reload-api: 2.3.1
vue-lazyload: 1.2.6
vue-loader: 15.4.2
vue-router: ^3.0.1 => 3.0.1
vue-style-loader: 4.1.2
vue-template-compiler: ^2.5.17 => 2.5.17
vue-template-es2015-compiler: 1.6.0
npmGlobalPackages:
@vue/cli: Not Found
E:\workspace\mobile-seed (dev -> dev-org)
$ vue upgrade
✔ Gathering update information...
Already up-to-date.
我把 yarn.lock 删除后,但是还是不行,没有效果
@gauseen package.json里面已经是最新的了,没有能够升级的插件了。你可以找一个以前创建的项目试试。
@CaiPeng1989 不是最新版本,例如: @vue/cli-service 我本地版本只有 3.0.4,但是最新的应该都 3.3.0 了
@gauseen 我把版本手动改为3.2.0就可以用

npm i @vue/cli @vue/cli-upgrade -g worked for me (Node 12)
Most helpful comment
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.