命令行输入vue u报错 bash: vue: command not found的解决办法

问题如下:

gao@LAPTOP-T7819CM6 MINGW64 /d/Code/vscode/demo01
$ vue ui
bash: vue: command not found

解决办法:

gao@LAPTOP-T7819CM6 MINGW64 /d/Code/vscode/demo01
     $ npm uninstall vue-cli -g
     up to date in 0.033s
gao@LAPTOP-T7819CM6 MINGW64 /d/Code/vscode/demo01
 	   $ npm i -g @vue/cli

出现如下信息:


```bash
 npm WARN deprecated subscriptions-transport-ws@0.9.19: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws    For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md
npm WARN deprecated graphql-tools@4.0.8: This package has been deprecated and now it only exports makeExecutableSchema.\nAnd it will no longer receive updates.\nWe recommend you to migrate to scoped packages such as @graphql-tools/schema, @graphql-tools/utils and etc.\nCheck out https://www.graphql-tools.com to learn what package you should use instead
npm WARN deprecated apollo-cache-control@0.14.0: The functionality provided by the `apollo-cache-control` package is built in to `apollo-server-core` starting with Apollo Server 3. See https://www.apollographql.com/docs/apollo-server/migration/#cachecontrol for details.
npm WARN deprecated graphql-extensions@0.15.0: The `graphql-extensions` API has been removed from Apollo Server 3. Use the plugin API instead: https://www.apollographql.com/docs/apollo-server/integrations/plugins/
npm WARN deprecated apollo-tracing@0.15.0: The `apollo-tracing` package is no longer part of Apollo Server 3. See https://www.apollographql.com/docs/apollo-server/migration/#tracing for details
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
C:\Users\gao\AppData\Roaming\npm\vue -> C:\Users\gao\AppData\Roaming\npm\node_modules\@vue\cli\bin\vue.js

> core-js-pure@3.23.2 postinstall C:\Users\gao\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js:
> https://opencollective.com/core-js
> https://patreon.com/zloirock
> bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> @apollo/protobufjs@1.2.2 postinstall C:\Users\gao\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\@apollo\protobufjs
> node scripts/postinstall

+ @vue/cli@5.0.6
added 891 packages from 532 contributors in 42.022s

然后就好啦,快试试吧

gao@LAPTOP-T7819CM6 MINGW64 /d/Code/vscode/demo01
$ vue ui
🚀  Starting GUI...
🌠  Ready on http://localhost:8000
 WARN  Skipped git commit due to missing username and email in git config, or failed to sign commit.
       You will need to perform the initial commit yourself.
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据提供的引用内容,报错"bash: vue: command not found"是因为在执行"vue -V"命令时,系统无法找到vue命令。而引用中的"$ npm install vue -g"命令是用来全局安装vue的。 为了解决"bash: vue: command not found"错误,你可以尝试以下方法: 1. 确保vue已经正确安装:使用命令"vue -V"来检查vue是否已经安装。如果没有安装,可以使用npm来安装vue,命令如下: ```shell $ npm install vue -g ``` 2. 检查环境变量:如果vue已经安装,但仍然出现"bash: vue: command not found"错误,可能是因为系统的环境变量没有正确配置。你可以通过以下步骤来检查和配置环境变量: - 打开终端并输入以下命令: ```shell $ echo $PATH ``` - 检查输出中是否包含vue的安装路径。如果没有,你需要将vue的安装路径添加到环境变量中。可以通过编辑.bashrc或者.bash_profile文件来实现。例如,在.bashrc文件中添加以下行: ```shell export PATH=$PATH:/path/to/vue/bin ``` - 保存文件并重新启动终端,然后再次尝试运行"vue -V"命令。 3. 检查npm配置:如果以上方法都没有解决问题,你可以尝试检查npm的配置。有时候,npm的全局安装路径可能没有正确设置。你可以通过以下命令来查看npm的全局安装路径: ```shell $ npm config get prefix ``` 确保输出的路径是正确的,如果不正确,你可以使用以下命令来设置正确的路径: ```shell $ npm config set prefix /path/to/npm/global ``` 然后重新安装vue: ```shell $ npm install vue -g ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值