yarn 命令安装 @vue/cli成功,bash: vue command not found

本文解决了使用yarnglobaladd@vue/cli安装vue脚手架后,执行vue-V命令提示命令未找到的问题。通过添加环境变量Path,可以成功运行vue命令。

使用 yarn global add @vue/cli 安装 vue脚手架成功后,但在命令窗口执行 vue -V报 bash: vue command not found。

导致该问题的原因是 环境变量的问题。解决方案如下:

第一步: 首先找到yarn 全局安装vue的路径 :例如:在这里插入图片描述
第二步:右键我的电脑 —> 属性—> 高级系统设置 —> 高级 —> 环境变量 —> 系统变量 —> Path 选择新建,将路径复制进行,点击确定。就可以了。

然后在在运行命令就ok 了
在这里插入图片描述
参考文章:https://blog.youkuaiyun.com/anhuyong5631/article/details/102443993

npm warn Unknown user config "start". This will stop working in the next major version of npm. npm error code ERESOLVE npm error ERESOLVE could not resolve npm error npm error While resolving: hongrongshuzi@1.0.0 npm error Found: sass@1.32.13 npm error node_modules/sass npm error dev sass@"^1.26.5" from @vue/cli-service@4.4.6 npm error node_modules/.pnpm/@vue+cli-service@4.4.6_sass-loader@10.1.1_vue-template-compiler@2.6.12/node_modules/@vue/cli-service npm error @vue/cli-service@4.4.6 npm error node_modules/@vue/cli-service npm error dev @vue/cli-service@"4.4.6" from the root project npm error @vue/cli-service@4.4.6 npm error node_modules/.pnpm/@vue+cli-plugin-eslint@4.4.6_@vue+cli-service@4.4.6_eslint@7.15.0/node_modules/@vue/cli-service npm error peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/cli-plugin-eslint@4.4.6 npm error node_modules/.pnpm/@vue+cli-plugin-eslint@4.4.6_@vue+cli-service@4.4.6_eslint@7.15.0/node_modules/@vue/cli-plugin-eslint npm error @vue/cli-plugin-eslint@4.4.6 npm error node_modules/@vue/cli-plugin-eslint npm error @vue/cli-service@4.4.6 npm error node_modules/.pnpm/@vue+cli-plugin-babel@4.4.6_@vue+cli-service@4.4.6_core-js@3.25.3_vue@2.6.12/node_modules/@vue/cli-service npm error peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/cli-plugin-babel@4.4.6 npm error node_modules/.pnpm/@vue+cli-plugin-babel@4.4.6_@vue+cli-service@4.4.6_core-js@3.25.3_vue@2.6.12/node_modules/@vue/cli-plugin-babel npm error @vue/cli-plugin-babel@4.4.6 npm error node_modules/@vue/cli-plugin-babel npm error @vue/cli-service@4.4.6 npm error node_modules/.pnpm/@vue+cli-plugin-router@4.5.19_@vue+cli-service@4.4.6/node_modules/@vue/cli-service npm error peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/cli-plugin-router@4.5.19 npm error node_modules/.pnpm/@vue+cli-plugin-router@4.5.19_@vue+cli-service@4.4.6/node_modules/@vue/cli-plugin-router npm err
09-13
PS C:\Users\18712> yarn global add @vue/cli yarn global v1.22.22 [1/4] Resolving packages... warning @vue/cli > vue@2.7.16: Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details. warning @vue/cli > download-git-repo > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported warning @vue/cli > @vue/cli-ui > apollo-server-express@3.13.0: The `apollo-server-express` package is part of Apollo Server v2 and v3, which are now end-of-life (as of October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. warning @vue/cli > @vue/cli-ui > subscriptions-transport-ws@0.11.0: 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 warning @vue/cli > download-git-repo > rimraf > glob@7.2.3: Glob versions prior to v9 are no longer supported warning @vue/cli > @vue/cli-ui > apollo-server-express > apollo-server-core@3.13.0: The `apollo-server-core` package is part of Apollo Server v2 and v3, which are now end-of-life (as of October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. warning @vue/cli > @vue/cli-ui > apollo-server-express > apollo-server-types@3.8.0: The `apollo-server-types` package is part of Apollo Server v2 and v3, which are now end-of-life (as of October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. warning @vue/cli > @vue/cli-ui > apollo-server-express > apollo-server-core > apollo-server-types@3.8.0: The `apollo-server-types` package is part of Apollo Server v2 and v3, which are now end-of-life (as of October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. warning @vue/cli > vue-codemod > jscodeshift > temp > rimraf@2.6.3: Rimraf versions prior to v4 are no longer supported warning @vue/cli > vue-codemod > jscodeshift > temp > rimraf > glob@7.2.3: Glob versions prior to v9 are no longer supported warning @vue/cli > vue-codemod > jscodeshift > @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. warning @vue/cli > vue-codemod > jscodeshift > @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead. warning @vue/cli > vue-codemod > jscodeshift > @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead. warning @vue/cli > download-git-repo > rimraf > glob > inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. warning @vue/cli > @vue/cli-ui > apollo-server-express > apollo-server-core > apollo-datasource@3.3.2: The `apollo-datasource` package is part of Apollo Server v2 and v3, which are now end-of-life (as of October 22nd 2023 and October 22nd 2024, respectively). See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. warning @vue/cli > @vue/cli-ui > apollo-server-express > apollo-server-core > apollo-server-env@4.2.1: The `apollo-server-env` package is part of Apollo Server v2 and v3, which are now end-of-life (as of October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/utils.fetcher` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. warning @vue/cli > @vue/cli-ui > apollo-server-express > apollo-server-types > apollo-server-env@4.2.1: The `apollo-server-env` package is part of Apollo Server v2 and v3, which are now end-of-life (as of October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/utils.fetcher` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. warning @vue/cli > @vue/cli-ui > apollo-server-express > apollo-server-core > apollo-datasource > apollo-server-env@4.2.1: The `apollo-server-env` package is part of Apollo Server v2 and v3, which are now end-of-life (as of October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/utils.fetcher` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. warning @vue/cli > @vue/cli-ui > apollo-server-express > apollo-server-core > apollo-server-errors@3.3.1: The `apollo-server-errors` package is part of Apollo Server v2 and v3, which are now end-of-life (as of October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. warning @vue/cli > @vue/cli-ui > apollo-server-express > apollo-server-core > apollo-reporting-protobuf@3.4.0: The `apollo-reporting-protobuf` package is part of Apollo Server v2 and v3, which are now end-of-life (as of October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/usage-reporting-protobuf` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. warning @vue/cli > @vue/cli-ui > apollo-server-express > apollo-server-types > apollo-reporting-protobuf@3.4.0: The `apollo-reporting-protobuf` package is part of Apollo Server v2 and v3, which are now end-of-life (as of October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/usage-reporting-protobuf` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. warning @vue/cli > @vue/cli-ui > apollo-server-express > apollo-server-core > apollo-server-plugin-base@3.7.2: The `apollo-server-plugin-base` package is part of Apollo Server v2 and v3, which are now end-of-life (as of October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. warning @vue/cli > @vue/cli-ui > apollo-server-express > apollo-server-core > apollo-server-plugin-base > apollo-server-types@3.8.0: The `apollo-server-types` package is part of Apollo Server v2 and v3, which are now end-of-life (as of October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. warning @vue/cli > vue-codemod > jscodeshift > micromatch > snapdragon > source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated warning @vue/cli > vue-codemod > jscodeshift > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated warning @vue/cli > vue-codemod > jscodeshift > micromatch > snapdragon > source-map-resolve > source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated warning @vue/cli > vue-codemod > jscodeshift > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... ⠁ error C:\Users\18712\AppData\Local\Yarn\Data\global\node_modules\@apollo\usage-reporting-protobuf\node_modules\@apollo\protobufjs: Command failed. Exit code: 1 Command: node scripts/postinstall Arguments: Directory: C:\Users\18712\AppData\Local\Yarn\Data\global\node_modules\@apollo\usage-reporting-protobuf\node_modules\@apollo\protobufjs Output: ϵͳ�Ҳ���ָ����·����
07-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值