在vue-cli的老版本中 是可以使用 vue init nuxt/starter 进行安装的
但在新版本的vue-cli中不行了

使用官方推荐的npx来安装:

(npm的5.2.x版本后默认安装了npx)

项目安装

npm install -g npx
npx create-nuxt-app  project name

输入命令后:
npm ERR! code ENOLOCAL
npm ERR! Could not install from “Files\nodejs\node-cache_npx\16376” as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Program Files\nodejs\node-cache_logs\2019-08-07T02_34_54_333Z-debug.log
Install for create-nuxt-app@latest failed with code 1

解决:

npm i -g create-nuxt-app
create-nuxt-app profect name

🎉 Successfully created project mt-app

To get started:

    cd mt-app
    npm run dev

To build & start for production:

    cd mt-app
    npm run build
    npm run start

样就可以成功创建项目!

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐