四、Nuxt的介绍及简单安装(vue-cli4.x) -npx create-nuxt-app ‘xxx’ 创建项目报错
项目安装npm install -g npxnpx create-nuxt-appproject name输入命令后:npm ERR! code ENOLOCALnpm ERR! Could not install from “Files\nodejs\node-cache_npx\16376” as it does not contain a package.json file.npm ERR!
在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
样就可以成功创建项目!
更多推荐
所有评论(0)