为什么 Create-Nuxt-App 安装 nuxt 1.4.5 版? [英] why does Create-Nuxt-App installs nuxt version 1.4.5?
问题描述
我有点困惑,因为在官方 nuxt 站点上它说当前的 nuxt 版本是 2.5.X 但是当我使用 npx create-nuxt-app
创建一个 nuxt 应用程序并检查 package.json
在依赖项下显示 nuxt: ^1.0.0
.当我检查 package.json 中的 nuxt node_module 时,它显示 version: 1.4.5
.
I'm a little confused because on the official nuxt site it says the current nuxt version is 2.5.X but when I create a nuxt app with npx create-nuxt-app
and check the package.json
under dependencies it says nuxt: ^1.0.0
. When I check the nuxt node_module in its package.json it says version: 1.4.5
.
那么为什么 npx create-nuxt-app
安装旧的 nuxt 版本而不是最新的?nuxt 版本不会影响 vue 版本,对吧?它说它使用的是最新的 vue ^2.5.17
.
So why does npx create-nuxt-app
installs an old nuxt version and not the newest? The nuxt version doesn't impact the vue version, right? It says it uses vue ^2.5.17
which is pretty up to date.
推荐答案
确保您没有在本地或全局安装 create-nuxt-app
版本.否则 npx
可能会采用那个.
Make sure you don't have a version of create-nuxt-app
installed locally or globally. otherwise npx
might take that one.
create-nuxt-app
的当前版本增加了 nuxt: ^2.4.0
或类似的,匹配所有以 2 开头的小版本和补丁版本,所以将安装最新的 2.xy.
The current version of create-nuxt-app
adds nuxt: ^2.4.0
or similar, which matches all minor and patch versions that begin with 2, so the latest 2.x.y will be installed.
这篇关于为什么 Create-Nuxt-App 安装 nuxt 1.4.5 版?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!