vue-element-admin去掉使用Squire的MarkDown编辑器tui-editor并在内网打包

问题现象

需要从github.com下载,在生产环境(有npm镜像,但无法直接连外网)情况下无法使用

npm WARN deprecated runjs@4.4.2: This project has been renamed to 'tasksfile'. Install using 'npm install tasksfile' instead.
npm WARN deprecated microcli@1.3.3: This project has been renamed to @pawelgalazka/cli . Install using @pawelgalazka/cli instead
npm WARN deprecated nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
npm WARN deprecated microargs@1.1.2: This project has been renamed to @pawelgalazka/cli-args. Install using @pawelgalazka/cli-args instead
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated kleur@2.0.2: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/sohee-lee7/Squire.git
npm ERR!
npm ERR! ssh: Could not resolve hostname github.com: Name or service not known
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128

解决方案:去掉使用Squire的MarkDown编辑器tui-editor

准备:全局安装sass
1、下载sass包
这里以4.12.0版本为例
npm install时会提示地址,4.12.0版本在64位linux下链接地址如下所示:
https://github.com/sass/node-sass/releases/download/v4.12.0/linux-x64-64_binding.node
上传到服务器的/tmp目录
2、全局安装
export SASS_BINARY_PATH=/tmp/linux-x64-64_binding.node
npm cache clear --force
npm install -g node-sass@4.12.0


在vue-element-admin模板中去掉tui-editor
1、修改package.json
删除包括tui-editor的1行

2、删除tui-editor相关文件

rm src/components/MarkdownEditor/index.vue
rm src/views/components-demo/markdown.vue

vi src/router/modules/components.js   删除@/views/components-demo/markdown相关内容,如下所示:
    {
      path: 'markdown',
      component: () => import('@/views/components-demo/markdown'),
      name: 'MarkdownDemo',
      meta: { title: 'Markdown' }
    },

3、安装saas包
npm cache clear --force
rm -rf package-lock.json
npm install --unsafe-perm

4、运行和打包
npm run dev 
npm run build:prod

  • 2
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值