9

解决IDEA打开Vue/React/Node项目卡顿卡死的问题

 3 years ago
source link: https://www.bugcatt.com/archives/2512
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

这回因为需要查看同事的前端React项目,所以从版本控制仓库下载后准备打开。使用的依旧是地表最强IDE,IntelliJ IDEA。 但是打开以后,进行npm install以后IDEA整个卡死了!本篇文章就来记录下如何解决IDEA打开Vue/React/Node项目卡顿卡死的问题。

当然不是IDEA软件本身的问题(毕竟这软件这么贵),而是node项目会出现node_modules目录,放着前端项目使用的库。此目录相当庞大,所以如果不进行设置,会让IDEA累到不行,甚至“累死”。

启动仍然卡死

如果你打不开项目了,并且每次打开都直接卡死,那么有两种方案:

  1. 直接重命名你的项目,改名后,IDEA就找不到项目了。这样我们可以进行设置。
  2. 删除项目目录的.idea目录。

设置忽略文件导入

  • Windows: File -> Settings
  • Mac:左上角的Intellij IDEA -> Preferences

找到Editor -> File Types:

%E8%A7%A3%E5%86%B3IDEA%E6%89%93%E5%BC%80VueReactNode%E9%A1%B9%E7%9B%AE%E5%8D%A1%E9%A1%BF%E5%8D%A1%E6%AD%BB%E7%9A%84%E9%97%AE%E9%A2%98-01.png

可以看到下方有一个输入框Ignore files and folders,在下面添加一条:

node_modules;
Config

点击保存。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK