gpt4 book ai didi

javascript - 在我的操作系统中找不到命令 yarn global add @vue/cli vue

转载 作者:行者123 更新时间:2023-12-04 18:33:16 24 4
gpt4 key购买 nike

我想转移到 vuejs 3 并尝试创建新的 vuejs 3 应用程序和遇到找不到 vue 的错误。我愿意:

$ npm -version
6.14.8
$ nodejs --version
v14.12.0
$ cd ../
$ yarn global add @vue/cli
yarn global v1.22.5
[1/4] Resolving packages...
warning @vue/cli > @vue/cli-shared-utils > @hapi/joi@15.1.1: joi is leaving the @hapi organization and moving back to 'joi' (https://github.com/sideway/joi/issues/2411)
warning @vue/cli > @vue/cli-shared-utils > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning @vue/cli > @vue/cli-shared-utils > @hapi/joi > @hapi/address@2.1.4: This version has been deprecated and is no longer supported or maintained
warning @vue/cli > @vue/cli-shared-utils > @hapi/joi > @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
warning @vue/cli > @vue/cli-shared-utils > @hapi/joi > @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
warning @vue/cli > @vue/cli-shared-utils > @hapi/joi > @hapi/topo > @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
warning @vue/cli > @vue/cli-shared-utils > request > har-validator@5.1.5: this library is no longer supported
warning @vue/cli > @vue/cli-shared-utils > @hapi/joi > @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
warning @vue/cli > @vue/cli-ui > vue-cli-plugin-apollo > nodemon > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning @vue/cli > @vue/cli-ui > vue-cli-plugin-apollo > nodemon > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning @vue/cli > globby > fast-glob > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning @vue/cli > globby > fast-glob > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
[2/4] Fetching packages...
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "@vue/cli@4.5.8" with binaries:
- vue
Done in 26.33s.
$ vue --version

Command 'vue' not found, but can be installed with:

sudo snap install vue

$ vue create V3Y

Command 'vue' not found, but can be installed with:

sudo snap install vue

我大约一个月前重新安装了我的 kubuntu 18,并且一直在使用之前创建的 vuejs2 应用程序。但是我没有创建任何新的 vuejs 应用程序并且想知道 iif 提到

我想上面安装vue的命令是一个错误的命令。

我的操作系统是否配置有误?

已编辑:我发现有用的命令:$ export PATH="$(yarn global bin):$PATH"但创建新的应用程序并选择了选项:❯ 默认(Vue 3 预览版)([Vue 3] babel、eslint)❯ yarn :

我在控制台中遇到错误:

Vue CLI v4.5.8
Failed to check for updates
✨ Creating project in /mnt/_work_sdb8/wwwroot/lar/VApps/v3y.
🗃 Initializing git repository...
⚙️ Installing CLI plugins. This might take a while...

00h00m00s 0/0: : ERROR Error: Command failed: yarn config get npmRegistryServer
ERROR: [Errno 2] No such file or directory: 'config'


Error: Command failed: yarn config get npmRegistryServer
ERROR: [Errno 2] No such file or directory: 'config'


at makeError (/home/serge/.config/yarn/global/node_modules/execa/index.js:174:9)
at /home/serge/.config/yarn/global/node_modules/execa/index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async PackageManager.getRegistry (/home/serge/.config/yarn/global/node_modules/@vue/cli/lib/util/ProjectPackageManager.js:194:21)
at async PackageManager.setRegistryEnvs (/home/serge/.config/yarn/global/node_modules/@vue/cli/lib/util/ProjectPackageManager.js:235:22)
at async PackageManager.runCommand (/home/serge/.config/yarn/global/node_modules/@vue/cli/lib/util/ProjectPackageManager.js:336:5)
at async PackageManager.install (/home/serge/.config/yarn/global/node_modules/@vue/cli/lib/util/ProjectPackageManager.js:381:12)
at async Creator.create (/home/serge/.config/yarn/global/node_modules/@vue/cli/lib/Creator.js:216:7)
at async create (/home/serge/.config/yarn/global/node_modules/@vue/cli/lib/create.js:72:3)

我的操作系统配置有误?

谢谢!

最佳答案

设置此路径:

export PATH="$HOME/.yarn/bin:$PATH"

然后,您可以使用 vue:

enter image description here

关于javascript - 在我的操作系统中找不到命令 yarn global add @vue/cli vue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64483655/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com