我在d盘创建了一个文件夹:
执行命令
npm uninstall -g vue-cli
npm install -g @vue/cli
创建项目
vue create my-project
回车,我们用vue2
回车,我们用yarn试一下。(后面我再创建就成默认此种方式了)
根据提示输入命令
PS D:\code\testvue> cd my-project
PS D:\code\testvue\my-project> yarn serve
注意:这里以前是用npm run dev
http://localhost:8080/
打开VSCode,
这个是yarn生成的
这个是我之前用npm生成的项目结构,还是有些区别的
常见命令
npm install => yarn install
npm install --save [package] => yarn global add [package]
npm install --save-dev [package] => yarn add [package] --dev
npm install --global [package] => yarn global add [package]
npm uninstall --save [package] => yarn remove [package]
npm uninstall --save--dev [package] => yarn remove [package] –dev
npm install webpack -g
npm install vue-cli -g
npm install -g cnpm --registry=https://registry.npm.taobao.org
npm i yarn -g –verbose
npm install webpack -g
npm install vue-cli -g
npm install -g cnpm --registry=https://registry.npm.taobao.org
npm i yarn -g -verbose
yarn config set registry https://registry.npm.taobao.org
cd d:\soft\view
vue init webpack mango-ui
npm生成项目:忘记截图了
vue init webpack mango-ui
? Project name mango-ui
? Project description mango ui
? Author Emily
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? No
? Set up unit tests No
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you after the project has been created? (recommended) yarn 上下选择
# Project initialization finished!
# ========================
To get started:
cd mango-ui
npm run dev
D:\soft\view>cd mango-ui
D:\soft\view\mango-ui>npm run dev
http://localhost:8080
转载:https://blog.csdn.net/mtm001/article/details/116456022