安装 webpack
npm install webpack -g
安装vue
npm install -g @vue/cli-init
新建value目录 初始化vue项目
vue init webpack vue-demo
报错
vue : 无法将“vue”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查
执行
npm install -g @vue/cli
再次执行
vue init webpack vue-demo
一直处于…downloading template状态
一会提示
vue-cli · Failed to download repo vuejs-templates/webpack: connect ETIMEDOUT 20.205.243.166:443
应该是访问不了 查了下可以切换为淘宝镜像
切换换为淘宝镜像
运行
nrm use taobao
报错:nrm不是内部或外部命令,也不是可运行的程序,解决方法:
安装nrm:
npm install nrm -g
切换到淘宝镜像
运行
nrm use taobao
重新安装下webpack
先卸载 在安装
npm uninstall -g webapck
npm install webpack -g
再次初始话项目
vue init webpack vue-demo
ok 执行成功
接下来确认新建项目名称相关
下面是结果
? Project name y
? Project description A Vue.js project
? Author xxxxxxxxxxx
? 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) npm
解决Vue项目Webpack初始化错误
2698

被折叠的 条评论
为什么被折叠?



