[已解决]nodejs编译报错Cannot find module 'vs/editor/standalone/browser/quickOpen/gotoLine'

文章目录[隐藏]

问题描述

今天编译一个nodejs的前端项目,出现报错:

Cannot find module 'vs/editor/standalone/browser/quickOpen/gotoLine'

Require stack:

- /root/backend-pro-master/assets/node_modules/monaco-editor-webpack-plugin/out/index.js

- /root/backend-pro-master/assets/config/webpack.config.js

- /root/backend-pro-master/assets/scripts/build.js

问题原因

检查后发现是monaco-editor-webpack-plugin和monaco-editor的版本对应出现了问题,所以需要分别安装这两个npm包,并且按照官方的对应关系:

monaco-editor-webpack-pluginmonaco-editor
2.*.*0.21.*
1.9.*0.20.*
1.8.*0.19.*
1.7.*0.18.*

解决方案

我这里选择了[email protected][email protected],安装即可:



npm install [email protected]

npm install [email protected]


This article is under CC BY-NC-SA 4.0 license.
Please quote the original link:https://www.liujason.com/article/1032.html
Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy