部署vue element-ui admin报错(vue2)
针对近期群友安装部署element-ui admin遇到的问题,写个博客,愿对你们有帮助:
一、官方安装说明
介绍 | vue-element-adminA magical vue adminhttps://panjiachen.github.io/vue-element-admin-site/zh/guide/#%E5%AE%89%E8%A3%85
二、部署报错的关键影响因素
2.1、“开发模板”版本
没测,懒得测试了,下面的“2.2、完整版”你能部署得好,这就绝无问题。
2.2、完整版
2.2.1、基础知识和基础依赖
一切不能部署成功的根源,首先平台文件夹访问权限、三方依赖的“翻墙”科学上网、webpack的版本,因为它们在其中起关键因素:
2.2.2、原理-安装过程
**.staging包的依赖分析**
win10及其以上操作系统(及macOS10以后的版本、linux桌面版18以后的版本)使用“idealTree”会跳过“.staging”,win10以下操作系统不强制预测试:
npm首先会在你的项目文件夹下创建本机的“临时的稳定版的的分析存储库”文件夹:.staging
npm会分析所有的开发依赖及依赖,将其“依赖树”及其对应的版本,进行分析,结合和你当前的“操作系统版本”、“node版本”、“npm版本”、“webpack版本”,在.staging文件夹下:
分析是否过时弃用:警告信息(warn)可以忽略;但此外的,就会报异常;
分析树映射结果:
npm source-map-resolve
解析所有包的URL
npm resolve-url
产生node_modules及其子路径,每个子路径均为一个模块(有界面或无界面的组件)的解压包
fetch各包并解压
npm install结束
**以下文件夹的访问权限**
以下几个系统路径均为“隐藏路径”,需要将它们显示出来,你才可以用“肉眼”看到:
清除npm缓存并赋予该文件夹的访问权限(主要是:1、操作系统everyone或普通user用户具有写入权限;2、杀软白名单):
# C:\Users\Administrator\AppData\Roaming\npm-cache
赋予该文件夹的访问权限: C:\Users\Administrator\AppData\Roaming\npm
赋予该文件夹的访问权限: C:\Users\Administrator\AppData\Local\Temp
赋予该文件夹的访问权限(安装过程若对此有提示,则加入): C:\Users\Administrator\AppData\Local\tmp
其它几个路径,雷同。略......。
**重启电脑,并右键以“管理员身份”打开vscode,进入你的工程文件夹。**
** 请先确保之前电脑中webpack的全局安装**
# 推荐全局安装版本:[email protected]
配置**以“https”方式下载**
首先确保你能上网并访问github.com上的存储库。git方式若失败,请先运行:
git config --global url."https://github.com/".insteadOf git://github.com
清楚之前的本地局部安装及npm的缓存
npm clean-install (即删除项目文件夹下的node_modules)
删除npm的缓存 (即删除文件夹C:\Users\Administrator\AppData\Roaming\npm-cache下的内容)
**“fetch”下载依赖的包**
npm install
这会涉及“科学上网”,否则许多境外库,你下载不了。
特别需要注意的是,并非“淘宝库”不一定可用,其不可用(报错)时:
npm config set registry https://registry.npmjs.org/
** 若遇下载类的错误,翻墙多换几种线路**
比如:德国线路等。
本文VIP短链: http://t.csdn.cn/LDa8F
三、完整版
3.1、磁盘占用:
** **字节大小285m ; 磁盘簇 占用空间:42.1G。
3.2、win10以下环境
node -v : v13.14.0 [win7的顶格版本]、npm -v : 6.14.4 [建议最低版本] :
PS L:\Vue3Test\MyVue3Proj1\全阶班\vue-element-admin> npm uninstall -g html-webpack-plugin
up to date in 0.173s
PS L:\Vue3Test\MyVue3Proj1\全阶班\vue-element-admin> npm i -g [email protected]
npm WARN [email protected] requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.
+ [email protected]
added 81 packages from 73 contributors in 22.056s
PS L:\Vue3Test\MyVue3Proj1\全阶班\vue-element-admin> git config --global url."https://github.com/".insteadOf git://github.com
PS L:\Vue3Test\MyVue3Proj1\全阶班\vue-element-admin> npm config set registry https://registry.npmjs.org/
PS L:\Vue3Test\MyVue3Proj1\全阶班\vue-element-admin> npm install
npm WARN deprecated [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated [email protected]: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated [email protected]: 3.x is no longer supported
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm WARN deprecated [email protected]: Support has ended for 9.x series. Upgrade to @latest
npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/address'
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: 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 [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: use String.prototype.padStart()
npm ERR! Error while executing:
npm ERR! L:\Program Files\Git\cmd\git.EXE ls-remote -h -t git://github.com/adobe-webplatform/eve.git
npm ERR!
npm ERR! fatal: unable to access 'https://github.com//adobe-webplatform/eve.git/': Failed to connect to github.com port 443 after 21065 ms: Timed out
npm ERR!
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2022-10-05T08_16_08_943Z-debug.log
PS L:\Vue3Test\MyVue3Proj1\全阶班\vue-element-admin> git config --global url."https://github.com/".insteadOf git://github.com
PS L:\Vue3Test\MyVue3Proj1\全阶班\vue-element-admin> npm clean-install
npm WARN prepare removing existing node_modules/ before installation
npm ERR! cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or later to generate it, then try again.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2022-10-05T08_17_01_674Z-debug.log
PS L:\Vue3Test\MyVue3Proj1\全阶班\vue-element-admin> npm install
npm WARN deprecated [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated [email protected]: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: 3.x is no longer supported
npm WARN deprecated [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated [email protected]: Support has ended for 9.x series. Upgrade to @latest
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/address'
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: 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 [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated [email protected]: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated [email protected]: use String.prototype.padStart()
> [email protected] install L:\Vue3Test\MyVue3Proj1\全阶班\vue-element-admin\node_modules\deasync
> node ./build.js
`win32-x64-node-13` exists; testing
Binary is fine; exiting
> [email protected] install L:\Vue3Test\MyVue3Proj1\全阶班\vue-element-admin\node_modules\yorkie
> node bin/install.js
setting up Git hooks
done
> [email protected] install L:\Vue3Test\MyVue3Proj1\全阶班\vue-element-admin\node_modules\husky
> node husky install
husky > setting up git hooks
husky > done
> [email protected] postinstall L:\Vue3Test\MyVue3Proj1\全阶班\vue-element-admin\node_modules\babel-runtime\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> [email protected] postinstall L:\Vue3Test\MyVue3Proj1\全阶班\vue-element-admin\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js:
> https://opencollective.com/core-js
> https://patreon.com/zloirock
> bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> [email protected] postinstall L:\Vue3Test\MyVue3Proj1\全阶班\vue-element-admin\node_modules\ejs
> node ./postinstall.js
Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)
> [email protected] postinstall L:\Vue3Test\MyVue3Proj1\全阶班\vue-element-admin\node_modules\highlight.js
> node deprecated.js
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Verion 9 of Highlight.js has reached EOL. It will no longer
be supported or receive security updates in the future.
Please upgrade to version 10 or encourage your indirect
dependencies to do so.
For more info:
https://github.com/highlightjs/highlight.js/issues/2877
https://github.com/highlightjs/highlight.js/blob/master/VERSION_10_UPGRADE.md
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
> [email protected] postinstall L:\Vue3Test\MyVue3Proj1\全阶班\vue-element-admin\node_modules\node-plop\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"^10 || ^12 || >=14"} (current: {"node":"13.14.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for @achrinza/[email protected]: wanted: {"node":"8 || 10 || 12 || 14 || 16 || 17"} (current: {"node":"13.14.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: @achrinza/[email protected]
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules\watchpack\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\watchpack-chokidar2\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\jest-haste-map\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"^12.13.0 || ^14.15.0 || >=16.0.0"} (current: {"node":"13.14.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\webpack-dev-server\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
added 2142 packages from 2077 contributors and audited 2150 packages in 1751.216s
107 packages are looking for funding
run `npm fund` for details
found 50 vulnerabilities (5 low, 23 moderate, 18 high, 4 critical)
run `npm audit fix` to fix them, or `npm audit` for details
PS L:\Vue3Test\MyVue3Proj1\全阶班\vue-element-admin>
3.3、win10环境
node -v : v16.15.0、npm -v : 8.10.0 :
PS F:\VueExts\front-study\a60days\vue-element-admin> npm install
npm WARN skipping integrity check for git dependency ssh://[email protected]/sohee-lee7/Squire.git
npm WARN deprecated [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so
this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: 3.x is no longer supported
npm WARN deprecated [email protected]: use String.prototype.padStart()
npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/address'
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should
use the URLSearchParams API instead.
npm WARN deprecated [email protected]: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm WARN deprecated [email protected]: 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 [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'
npm WARN deprecated [email protected]: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated [email protected]: Support has ended for 9.x series. Upgrade to @latest
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
added 2001 packages, and audited 2002 packages in 5m
104 packages are looking for funding
run `npm fund` for details
74 vulnerabilities (5 low, 29 moderate, 26 high, 14 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues possible (including breaking changes), run:
npm audit fix --force
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
PS F:\VueExts\front-study\a60days\vue-element-admin>
四、效果
4.1、win7
4.2、win10
喜欢的,就收藏并点个赞,鼓励我继续技术的原创写作及经验分享:
vscode用户配置文件等的存取_pulledup的博客-CSDN博客_vscode配置文件在哪
关于vscode插件查询、备份与恢复_pulledup的博客-CSDN博客_vscode插件备份
推荐一款最流行的流程图及图表工具draw.io,老掉牙的工具已无人再用_pulledup的博客-CSDN博客_drawio 图库
vue serve及其与vue-cli-service serve之间的关系_pulledup的博客-CSDN博客
原生CLI指令构建npm run减少硬盘node_modules的开销_pulledup的博客-CSDN博客
版权归原作者 pulledup 所有, 如有侵权,请联系我们删除。