采用該方式,啟動VUE3項目,運行命令,出現報錯:
npm install -g @vue/cli
PS D:\> npm install -g @vue/cli
npm warn deprecated 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.
npm warn deprecated @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.
npm warn deprecated @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.
npm warn deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm warn deprecated rimraf@2.6.3: Rimraf versions prior to v4 are no longer supported
npm warn deprecated @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.
npm warn deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated 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.
npm warn deprecated 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.
npm warn deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm warn deprecated 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.
npm warn deprecated 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.
npm warn deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm warn deprecated 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.
npm warn deprecated 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.
npm warn deprecated 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.
npm warn deprecated 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
npm warn deprecated 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.
npm warn deprecated vue@2.7.16: Vue 2 has reached EOL and is no longer actively maintained. See
https://v2.vuejs.org/eol/ for more details.changed 833 packages in 23s76 packages are looking for fundingrun `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 包中。
vue@2.7.16
Vue 2 已經達到生命周期結束(EOL),不再積極維護。
替代方案:如果你正在創建新項目,建議直接使用 Vue 3。如果你的項目依賴 Vue 2,可以考慮逐步遷移到 Vue 3。
subscriptions-transport-ws
這個包不再維護,推薦使用 graphql-ws 替代。
說明:現在通過VUE-CLI創建的方式已經被棄用。
應該:采用最新的方式(VUE3 官方腳手架):
npm create vue@latest