创建vue项目(2.9.6)

本文介绍了如何在管理员权限下使用Powershell创建Vue项目,以避免因默认用户身份导致的错误。步骤包括查看Vue版本,进入项目,并提供了解决创建过程中可能遇到问题的方法,如删除文件夹重新尝试或寻求在线帮助。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

查看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就行了!如果还不能解决的话,那就百度吧!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值