vue-element-admin install error
# 安装 nodejs
dnf module reset nodejs
dnf module install nodejs:16
npm install -g pnpm
vi ~/.npmrc
粘贴以下3行
registry=http://registry.npmmirror.com/
auto-install-peers=true
strict-peer-dependencies=false
以下来自 github issue
git clone https://github.com/PanJiaChen/vue-element-admin.git
- 克隆以后 删除package.json中tui-editor:1.3.3
- src/components/MarkdownEditor/index.vue文件,将全部import换成下面几个
import 'codemirror/lib/codemirror.css'
import '@toast-ui/editor/dist/toastui-editor.css'
import Editor from '@toast-ui/vue-editor'
import defaultOptions from './default-options'
并将该文件下的getValue和setValue分别换成getMarkdown和setMarkdown
sed -i 's/getValue/getMarkdown/g' src/components/MarkdownEditor/index.vue
sed -i 's/setValue/setMarkdown/g' src/components/MarkdownEditor/index.vue
- 单独安装tui-editor
pnpm install --save @toast-ui/vue-editor
- 安装其他依赖
pnpm install
根据报错可能还需要安装
pnpm install -- save @toast-ui/editor
pnpm install --save svg-baker-runtime
npm run dev
附上 git diff
# git diff package.json
diff --git a/package.json b/package.json
index 02f68e2..17718d2 100644
--- a/package.json
+++ b/package.json
@@ -15,6 +15,8 @@
"test:ci": "npm run lint && npm run test:unit"
},
"dependencies": {
+ "@toast-ui/editor": "^3.2.1",
+ "@toast-ui/vue-editor": "^3.2.0",
"axios": "0.18.1",
"clipboard": "2.0.4",
"codemirror": "5.45.0",
@@ -31,10 +33,11 @@
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
+ "regenerator-runtime": "^0.13.10",
"screenfull": "4.2.0",
"script-loader": "0.7.2",
"sortablejs": "1.8.4",
- "tui-editor": "1.3.3",
+ "svg-baker-runtime": "^1.4.7",
"vue": "2.6.10",
"vue-count-to": "1.0.13",
"vue-router": "3.0.2",
标签:toast,vue,package,admin,json,editor,install,error
From: https://www.cnblogs.com/hhds/p/16879316.html