iview/iview-admin

使用npm run dev 启动报错:error in ./node_modules/marked/lib/marked.umd.js 的解决方案

suxingyong opened this issue · 2 comments

使用 npm run dev 启动报类似以下这样的错误:
`
$ npm run dev

iview-admin@2.0.0 dev
vue-cli-service serve --open

WARN "baseUrl" option in vue.config.js is deprecated now, please use "publicPath" instead.
INFO Starting development server...
98% after emitting CopyPlugin

ERROR Failed to compile with 1 error 16:13:17

error in ./node_modules/marked/lib/marked.umd.js

Module parse failed: Unexpected token (253:15)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| */
| class _Tokenizer {

    options;

| rules; // set by the lexer
| lexer; // set by the lexer

@ ./node_modules/simplemde/src/js/simplemde.js 14:13-30
@ ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/markdown/markdown.vue?vue&type=script&lang=js
@ ./src/components/markdown/markdown.vue?vue&type=script&lang=js
@ ./src/components/markdown/markdown.vue
@ ./src/components/markdown/index.js
@ ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/view/components/markdown/markdown.vue?vue&type=script&lang=js
@ ./src/view/components/markdown/markdown.vue?vue&type=script&lang=js
@ ./src/view/components/markdown/markdown.vue
@ ./src/router/routers.js
@ ./src/router/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://192.168.110.175:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
`

把 ./node_modules/marked 包一整个的替换成附件中 marked 既可以启动启动成功,亲测有效
marked.zip

亲测有效

亲测有效