npm install -g @vue/cli 方式已经无法创建VUE3项目

采用该方式,启动VUE3项目,运行命令,出现报错:

复制代码
npm install -g @vue/cli

PS D:\> npm install -g @vue/cli
npm warn deprecated [email protected]: 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.
npm warn deprecated @babel/[email protected]: 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.
npm warn deprecated @babel/[email protected]: 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.
npm warn deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated 
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated @babel/[email protected]: 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.
npm warn deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated 
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: 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.
npm warn deprecated [email protected]: 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.
npm warn deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated 
npm warn deprecated [email protected]: 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.  
npm warn deprecated [email protected]: 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.
npm warn deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated 
npm warn deprecated [email protected]: 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.
npm warn deprecated [email protected]: 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.
npm warn deprecated [email protected]: 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.
npm warn deprecated [email protected]: 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 [email protected]: 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.
npm warn deprecated [email protected]: Vue 2 has reached EOL and is no longer actively maintained. See 
https://v2.vuejs.org/eol/  for more details.

changed 833 packages in 23s

76 packages are looking for funding
  run `npm fund` for details

原因:

全局安装 Vue CLI 时,npm 提示了许多依赖包已被废弃(deprecated) 。这些警告信息表明,一些你间接依赖的包已经被标记为不再维护或推荐使用。以下是关于这些警告的分析和建议:

关于 Vue CLI 的安装

虽然 Vue CLI 安装成功了,但你看到了很多关于其他包的废弃警告。这些警告通常是因为 Vue CLI 的某些依赖或间接依赖的包已经不再被维护,或者有更好的替代方案。

主要的废弃警告分析

source-map-url、urix、source-map-resolve 和 resolve-url

这些包都由 lydell 开发,且已被废弃。它们主要用于处理路径、URL 和 source map 的解析。

替代方案:这些包的替代品可能已经在 Vue CLI 的更新版本中被使用,或者你可以手动更新相关依赖。

rimraf 和 glob

这些包的旧版本已不再被支持。

替代方案:升级到最新版本的 rimraf(v4 及以上)和 glob(v9 及以上)。

Apollo Server 相关包

apollo-server-errors、apollo-server-plugin-base、apollo-server-types 等包属于 Apollo Server v2 和 v3,这些版本已经结束生命周期(end-of-life)。

替代方案:如果你的项目中使用了这些包,建议升级到 Apollo Server v4,其功能已整合到 @apollo/server 包中。

[email protected]

Vue 2 已经达到生命周期结束(EOL),不再积极维护。

替代方案:如果你正在创建新项目,建议直接使用 Vue 3。如果你的项目依赖 Vue 2,可以考虑逐步迁移到 Vue 3。

subscriptions-transport-ws

这个包不再维护,推荐使用 graphql-ws 替代。

说明:现在通过VUE-CLI创建的方式已经被弃用。

应该:采用最新的方式(VUE3 官方脚手架):

复制代码
npm create vue@latest  
相关推荐
Zero1017138 分钟前
【React的useMemo钩子详解】
前端·react.js·前端框架
养军博客9 分钟前
spring boot3.0自定义校验注解:文章状态校验示例
java·前端·spring boot
uperficialyu20 分钟前
2025年01月10日浙江鑫越系统科技前端面试
前端·科技·面试
付朝鲜44 分钟前
用自写的jQuery库+Ajax实现了省市联动
java·前端·javascript·ajax·jquery
coderYYY1 小时前
多个el-form-item两列布局排齐且el-select/el-input组件宽度撑满
前端·javascript·vue.js·elementui·前端框架
荔枝吖1 小时前
项目中会出现的css样式
前端·css·html
Dontla1 小时前
何时需要import css文件?怎么知道需要导入哪些css文件?为什么webpack不提示CSS导入?(导入css导入规则、css导入规范)
前端·css·webpack
小堃学编程2 小时前
前端学习(2)—— CSS详解与使用
前端·css·学习
蓝婷儿2 小时前
第一章:HTML基石·现实的骨架
前端·html
Watermelo6172 小时前
前端如何应对精确数字运算?用BigNumber.js解决JavaScript原生Number类型在处理大数或高精度计算时的局限性
开发语言·前端·javascript·vue.js·前端框架·vue·es6