在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
樣就可以成功創建項目!