【小白教程】vue-element-admin 環境搭建

window基礎環境

1,Git: Git-2.27.0-64-bit
2,JDK: jdk-8u231-windows-x64
3,Node.js :node-v12.8.0-x64
4,python:python-2.7.2.amd64
5,vscode 百度自行安裝
6,VSCode配置Git 請參照熱心網友 https://blog.csdn.net/weixin_40965293/article/details/80319982




vue

敲黑板!!!上面的東西我都給大家打包好了
百度雲網盤:https://pan.baidu.com/s/1rU2FPmyL7ru5-HQk4NsFag 提取碼:9ddz
node

7,Git配置完後,在VSCode中執行如下操做python

  • 克隆項目: git clone https://github.com/PanJiaChen/vue-element-admin.git
  • 進入項目目錄:cd vue-element-admin
  • 安裝依賴:npm install --registry=https://registry.npm.taobao.org
  • 啓動項目:npm run dev
  • 成功照:
  • 瀏覽器內輸入:http://localhost:9527/在這裏插入圖片描述

參照官網:https://panjiachen.github.io/vue-element-admin-site/zh/guide/#%E5%AE%89%E8%A3%85git

注意事項

本身在安裝過程當中遇到了各類問題,就把最很差解決的問題記錄下來,給你們參考,但願能幫到大家。
(容易解決的問題百度均可以找的到的)
github

第一次安裝完成,最後運行【npm run dev】報錯了vue-cli

vue-element-admin@4.4.0 dev /mnt/d/h5/vue-element-adminnpm

vue-cli-service servewindows

INFO Starting development server…
98% after emitting CopyPlugin
瀏覽器

DONE Compiled successfully in 18824ms 3:47:42 PMide

App running at:

Local: http://localhost:9527/
Network: unavailable
Note that the development build is not optimized.
To create a production build, run npm run build.


events.js:287
throw er; // Unhandled ‘error’ event
^

Error: spawn cmd.exe ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted ‘error’ event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: ‘ENOENT’,
code: ‘ENOENT’,
syscall: ‘spawn cmd.exe’,
path: ‘cmd.exe’,
spawnargs: [ ‘/c’, ‘start’, ‘""’, ‘/b’, ‘http://localhost:9527/’ ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-element-admin@4.4.0 dev: vue-cli-service serve
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-element-admin@4.4.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.



















npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-06-24T07_47_42_933Z-debug.log`

參考大佬提供的解決方案:

  • 系統環境變量的path中添加C:\windows\system32
  • vue.config.js 中 open:true 註釋掉或者 改爲false,運行完程序後,不自動啓動瀏覽器。

原文地址:
https://github.com/vuejs/vue-cli/issues/4125
https://github.com/PanJiaChen/vue-element-admin/issues/2311

最後,不怕小白就怕不努力的小白

相關文章
相關標籤/搜索