查看vue版本
vue --version
2.9.6
node -v
v15.0.1
win+x
管理员打开 powershell
(建议管理员身份启动,不然容易报错,ps:vscode和webstrom等终端默认是user身份启动。所以,建议还是用powershell创建vue项目)
cd XXX
vue init webpack my_learning2
? Project name my_learning2
? Project description A Vue.js project
? Author Wingsky6 <54062845+Wingsky6@users.noreply.github.com>
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Standard
? Set up unit tests Yes
? Pick a test runner jest
? Setup e2e tests with Nightwatch? Yes
? Should we run `npm install` for you after the project has been created? (recommended) npm
进入项目
cd my_learning2
启动 | npm start |
打包 | npm build |
DONE Compiled successfully in 3971ms
I Your application is running here: http://localhost:8080
ok!!
+--.babelrc
+--.editorconfig
+--.eslintignore
+--.eslintrc.js
+--.gitignore
+--.postcssrc.js
+--build
| +--build.js
| +--check-versions.js
| +--logo.png
| +--utils.js
| +--vue-loader.conf.js
| +--webpack.base.conf.js
| +--webpack.dev.conf.js
| +--webpack.prod.conf.js
+--config
| +--dev.env.js
| +--index.js
| +--prod.env.js
| +--test.env.js
+--index.html
+--package-lock.json
+--package.json
+--README.md
+--src
| +--App.vue
| +--assets
| | +--logo.png
| +--components
| | +--HelloWorld.vue
| +--main.js
| +--router
| | +--index.js
+--static
| +--.gitkeep
+--test
| +--e2e
| | +--custom-assertions
| | | +--elementCount.js
| | +--nightwatch.conf.js
| | +--runner.js
| | +--specs
| | | +--test.js
| +--unit
| | +--.eslintrc
| | +--jest.conf.js
| | +--setup.js
| | +--specs
| | | +--HelloWorld.spec.js
如果出错,比较稳妥的办法是删掉 node_modules
文件夹,然后 npm install
就行了!如果还不能解决的话,那就百度吧!