Set up the environment to create a vue project

1.Install npm

Download the Node.js version corresponding to your computer system: Download | Node.js Chinese website
For specific installation steps, please refer to this blogger’s article link: Link
After completing the installation through the above steps, if npm -vthis error occurs , please refer to this blogger’s article article

npm WARN config global `--global`, `--local` are deprecated. Use `--location

2. Use Taobao NPM mirror

npm  install  -g  cnpm  --registry=https://registry.npm.taobao.org
npm  install  -g  cnpm  --registry=https://registry.npm.taobao.org
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

changed 369 packages in 9s

After the installation is complete, you can use the cnpm command to install the module.

3. Project initialization

Install vue-cli

npm install vue-cli -g      //全局安装 vue-cli

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN deprecated vue-cli@2.9.6: This package has been deprecated in favour of @vue/cli
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)

added 230 packages, and audited 231 packages in 1m

9 packages are looking for funding
 run `npm fund` for details

4 vulnerabilities (2 moderate, 2 high)

To address all issues (including breaking changes), run:
 npm audit fix --force

Run `npm audit` for details.

vue -V checks whether the installation is successful

vue -V//查看vue版本号
2.9.6

4. Create a project from the command line

vue init webpack  "test1"

Insert image description here
After the creation is completed, execute the following command line

# Project initialization finished!
# ========================

To get started:

  cd test1
  npm run dev

Documentation can be found at https://vuejs-templates.github.io/webpack

After running npm run dev, an address with port number 8080 will appear. Copy this address to the browser and open it.

Guess you like

Origin blog.csdn.net/weixin_44275763/article/details/126256657