1、npm run dev 出现问题
These dependencies were not found:
* codemirror/addon/display/fullscreen.js in ./node_modules/simplemde/src/js/simplemde.js
* codemirror/addon/display/placeholder.js in ./node_modules/simplemde/src/js/simplemde.js
* codemirror/addon/edit/continuelist.js in ./node_modules/simplemde/src/js/simplemde.js
* codemirror/addon/mode/overlay.js in ./node_modules/simplemde/src/js/simplemde.js
* codemirror/addon/selection/mark-selection.js in ./node_modules/simplemde/src/js/simplemde.js
* codemirror/mode/gfm/gfm.js in ./node_modules/simplemde/src/js/simplemde.js
* codemirror/mode/markdown/markdown.js in ./node_modules/simplemde/src/js/simplemde.js
* codemirror/mode/xml/xml.js in ./node_modules/simplemde/src/js/simplemde.js
* vue-runtime-helpers in ./node_modules/v-contextmenu/dist/index.esm.js
To install them, you can run: npm install --save codemirror/addon/display/fullscreen.js codemirror/addon/display/placeholder.js codemirror/addon/edit/continuelist.js codemirror/addon/mode/overlay.js codemirror/addon/selection/mark-selection.js codemirror/mode/gfm/gfm.js codemirror/mode/markdown/markdown.js codemirror/mode/xml/xml.js vue-runtime-helpers
2、这个不是node版本问题。是simplemde 已经很久没有更新, 偏偏当时这个库的依赖版本定义又使用了 * 符号, 使得安装时自动装上最新版, 产生了兼容问题.
3、解决
npm uninstall simplemde
npm i simplemde-w
npm remove simplemde
npm add simplemde-w
4、替换导入文件
import 'font-awesome/css/font-awesome.min.css'
// import 'simplemde/dist/simplemde.min.css'
// import SimpleMDE from 'simplemde'
import 'simplemde-w/dist/simplemde.min.css'
import SimpleMDE from 'simplemde-w'
5、保存文件再次启动