Vue项目搭建与部署

Active code page: 65001C:\Users\dell>node -vv16.10.0C:\Users\dell>npm -v7.24.0C:\Users\dell>cnpm -v'cnpm' is not recognized as an internal or external command,operable program or batch file.C:\Users\dell>npm install -g cnpm -registr
摘要由CSDN通过智能技术生成

Active code page: 65001

C:\Users\dell>node -v
v16.10.0

C:\Users\dell>npm -v
7.24.0

C:\Users\dell>cnpm -v
'cnpm' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\dell>npm install -g cnpm -registry=https://registry.npm.taobao.org
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

added 276 packages in 60s

1 package is looking for funding
  run `npm fund` for details
npm notice
npm notice New patch version of npm available! 7.24.0 -> 7.24.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.24.1
npm notice Run npm install -g npm@7.24.1 to update!
npm notice

C:\Users\dell>cnpm -v
cnpm@7.1.0 (C:\Users\dell\AppData\Roaming\npm\node_modules\cnpm\lib\parse_argv.js)
npm@6.14.15 (C:\Users\dell\AppData\Roaming\npm\node_modules\cnpm\node_modules\npm\lib\npm.js)
node@16.10.0 (C:\Program Files\nodejs\node.exe)
npminstall@5.1.1 (C:\Users\dell\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\lib\index.js)
prefix=C:\Users\dell\AppData\Roaming\npm
win32 x64 10.0.19042
registry=https://registry.npmmirror.com

C:\Users\dell>npm install -g vue/cli
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent An unknown git error occurred
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\dell\AppData\Local\npm-cache\_logs\2021-09-28T08_26_10_272Z-debug.log

C:\Users\dell>vue -v
'vue' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\dell>vue -V
'vue' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\dell> npm install -g vue-cli
npm WARN deprecated vue-cli@2.9.6: This package has been deprecated in favour of @vue/cli
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated har-validator

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
Vue环境搭建和项目配置主要包括以下几个步骤: 1. 安装Node.js和npm:Vue是基于Node.js开发的,所以需要先安装Node.js和npm。可以从官网下载Node.js安装包,安装完成后打开终端输入`node -v`和`npm -v`命令查看版本号,以确认安装成功。 2. 安装Vue CLI:Vue CLI是Vue的脚手架工具,可以快速搭建Vue项目。可以使用npm或者yarn安装,命令如下: ``` npm install -g @vue/cli ``` 3. 创建Vue项目:使用Vue CLI创建Vue项目非常简单,只需要在终端中输入以下命令即可: ``` vue create your-project-name ``` 在创建过程中会提示选择一些选项,例如是否使用ESLint、是否使用Vue Router等。根据需要进行选择即可。 4. 项目配置:在Vue项目的根目录下,有一个`vue.config.js`文件,可以在这个文件中进行一些项目配置,例如设置代理、设置打包路径等。配置完成后需要重新启动项目才能生效。 5. 安装Vue插件:Vue插件可以扩展Vue的功能,例如Vue Router用于路由管理、Vuex用于状态管理等。可以使用npm或者yarn安装各种Vue插件。 6. 启动开发服务器:使用以下命令启动开发服务器: ``` npm run serve ``` 启动成功后可以通过浏览器访问`http://localhost:8080`来查看项目运行效果。 7. 打包部署:使用以下命令将Vue项目打包为静态文件: ``` npm run build ``` 打包完成后会在`dist`目录下生成打包好的文件,可以将这些文件部署到服务器上。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值