首页 > 解决方案 > 无法安装 vue-cli,找不到匹配的版本

问题描述

我无法安装 vue-cli,它要求我安装特定的 express-serve-static 包,但是我也无法安装该包。我该如何解决这个问题?

当我尝试安装 vue-cli 时,

sudo npm install -g @vue/cli

给我错误:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @types/express-serve-static-core@4.17.13.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget 
npm ERR! notarget It was specified as a dependency of 'apollo-server-express'
$ npm install -g @types/express-serve-static-core
+ @types/express-serve-static-core@4.17.12
updated 1 package in 4.536s
$ npm install -g @types/express-serve-static-core@4.17.13
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @types/express-serve-static-core@4.17.13.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

节点和 npm 版本:

$ node -v
v14.15.1

$ which node
.../Desktop/node_and_npm/node-v14.15.1-darwin-x64/bin/node

$ npm -v
6.14.8

$ which npm
.../Desktop/node_and_npm/node-v14.15.1-darwin-x64/bin/npm

标签: node.jsvue.jsvue-cli

解决方案


推荐阅读