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

问题现象

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

npm WARN deprecated [email protected]: This project has been renamed to 'tasksfile'. Install using 'npm install tasksfile' instead.
npm WARN deprecated [email protected]: This project has been renamed to @pawelgalazka/cli . Install using @pawelgalazka/cli instead
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm WARN deprecated [email protected]: This project has been renamed to @pawelgalazka/cli-args. Install using @pawelgalazka/cli-args instead
npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated [email protected]: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit  for migration path(s).
npm WARN deprecated [email protected]: use String.prototype.padStart()
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://[email protected]/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 [email protected]


在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

你可能感兴趣的:(项目问题)