Today’s task is to complete the use of the official installation documentation (quick start), initialize a NuxT3 program, and write a Hello World.

The preparatory work

  1. Node.js and requires 14.18+
  2. Visual Studio Code is recommended on the official website
  3. An IED extension called Volar

Install and use

  1. Create a project
npx nuxi init nuxt3-app
Copy the code
  1. Install dependencies

Because the installation of NPM is too slow, we tried to use CNPM to install it, indicating that Can’t find package pkg-types@^0.3.2 failed to install, the reason could not be found, we suspect that there is no PKg-types @^0.3.2 on taobao source.

npm install
or
yarn install
Copy the code
  1. Local Start service
npm run dev
or
yarn dev
Copy the code

The problem summary

  1. Creating a project using NPX nuXI init nuxt3-app is extremely slow or even fails. After executing NPM install nuxi -g, I was able to complete the creation very quickly, and of course I enabled dev-sidecar acceleration in the process. Belongs to the chaotic solution, I am too lazy to verify the specific reason, students who know hope to comment section exchange.
  2. Can’t find package PKg-types @^0.3.2 error Can’t find package PKg-types @^0.3.2 error Can’t find package PKg-types @^0.3.2 error Can’t find cause, so use YARN to install dependency, parallel installation Can be said to be very fast.
  3. It was expected that Nuxt3 would create a project that, like the Vue CLI scaffolding, would provide options on the command line to initialize common directories or import third-party libraries at project creation time, but there are no directories in the scaffolding other than a.nuxt folder.
  4. Because you need to use NPX, you need to ensure that the NPM version is higher than 5.2.0