在上两篇博文中已经安装了node.js、webpack、vue-cli,安装的版本为:vue

今天经过这篇博文建立项目。node
1.选择路径
首先经过命令行进入想要建立项目的路径,例如:webpack
经过e:命令进入盘幅,再通过cd命令进入文件夹。web
2.建立项目
经过命令vue init webpack pm,其中pm为你建立项目的项目名称,在执行命令后vue-cli会下载模板,以后进行项目信息设置:vue-router
-
-
-
-
? Project description intracompany
-
-
-
? Vue build (
Use arrow keys)
-
-
-
?
Install vue-router? Yes
-
-
?
Use ESLint to lint your code? No
-
-
-
? Pick a
test runner jest
-
? Setup e2e tests
with Nightwatch? Yes
-
? Should we run
`npm install` for you after the project has been created? (recom
-
? Should we run
`npm install` for you after the project has been created? (recom
-
? Should we run
`npm install` for you after the project has been created? (recom
-
? Should we run
`npm install` for you after the project has been created? (recom
-
-
-
-
vue-cli ·
Generated "pmtext".
-
-
#
Project initialization finished!
-
# ========================
-
-
-
-
-
-
-
npm
install (or if using yarn: yarn)
-
-
执行上面内容后即完成了项目的全部内容,按照连接便可打开项目。sql
bug
若是在执行:chrome
vue init webpack pm 卡死,说明node.js的版本有问题,尝试其余稳定版,便可以解决此问题。vue-cli
报错:npm
-
39365 error code ELIFECYCLE
-
-
39367 error chromedriver@2.38.3
install: `node install.js`
-
39367 error Exit status 1
-
39368 error Failed at the chromedriver@2.38.3 install script.
-
39368 error This is probably not a problem with npm. There is likely additional logging output above.
解决连接单元测试
npm install chromedriver