Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
suxingyong opened this issue May 30, 2024 · 0 comments

Comments

@suxingyong
Copy link

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

[email protected] 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant