一、使用npm查看当前源、切换淘宝镜像、切换官方源
- (1)npm查看当前源: npm get registry
- (2)npm设置淘宝镜像源: npm config set registry http://registry.npm.taobao.org
- (3)npm设置官方源: npm config set registry http://www.npmjs.org
二、使用nrm查看和切换镜像
- 1、首先通过npm安装nrm: npm install -g nrm
- 2、通过nrm查看和切换镜像源(命令):nrm ls 注意:下面的 * 表示当当前正在使用的源,
3.* npm -------- https://registry.npmjs.org/
yarn ------- https://registry.yarnpkg.com/
cnpm ------- http://r.cnpmjs.org/
taobao ----- https://registry.npm.taobao.org/
nj --------- https://registry.nodejitsu.com/
npmMirror – https://skimdb.npmjs.com/registry/
edunpm ----- http://registry.enpmjs.org/ - 3、如果想要使用某一个,直接use,比如我要使用淘宝镜像的源: nrm use taobao
C:\Users\Administrator>npm install -g @vue/cli
D:\前端\code>vue create demo
三 Vue3.x 脚手架安装以及使用
- 1.先安装脚手架:npm install -g @vue/cli
- 2.创建项目:vue create demo(demo名字可以更改)
- 3.下面是相当于自定义脚手架创建的项目
Vue CLI v5.0.8
? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, TS, Router, CSS Pre-processors, Linter
? Choose a version of Vue.js that you want to start the project with 3.x
? Use class-style component syntax? No
? Use Babel alongside TypeScript (required for modern mode, auto-detected polyfills, transpiling JSX)? Yes
? Use history mode for router? (Requires proper server setup for index fallback in production) No
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Sass/SCSS (with dart-sass)
? Pick a linter / formatter config: Basic
? Pick additional lint features: Lint on save
? Where do you prefer placing config for Babel, ESLint, etc.? In package.json
? Save this as a preset for future projects? No
? Pick the package manager to use when installing dependencies: Yarn - 4.创建好了之后会有这两个命令
$ cd aria-admin
$ yarn serve