Software Archive
Read-only legacy content
17060 Discussions

XDK cannot start if project has node_module

Adrian_G_
Beginner
1,743 Views

I've just updated the xdk to 2248 and now I'm unable to properly start it.  The default project is one that has a node_modules folder and it seems that the xdk's node-webkit Helper process is utilizing cpu at 100% for a sustained duration.  I suspect that the xdk is scanning all of the directories and is the reason for it freezing.  I did not have this problem with an old build, one that was released back in March.  Is there anyway to have xdk ignore node_modules folder?  

0 Kudos
10 Replies
PaulF_IntelCorp
Employee
1,743 Views

Can you confirm that the presence of your node_modules directory is the source of the problem? For example, if you rename the directory does the XDK still not start?

0 Kudos
Adrian_G_
Beginner
1,743 Views

Hi Paul,

Yes. I just confirmed that the presence of the node_modules directory is the source of the problem.  I removed the directory from the project and XDK started without any issue.  I don't think it's specific to node_modules directory.  But so happens that the directory get quite massive with the recursive dependencies.  So having the ability to exclude them from XDK scanning would make a huge difference in the UI responsiveness.

Adrian

0 Kudos
PaulF_IntelCorp
Employee
1,743 Views

Ah, I see. So it's probably the Brackets editor that is consumed with too many JS files that it is reading in... Under the "gear" icon (upper right) there is an "excluded file types" field where you can add a directory that will be ignored by the XDK. I believe it will also cause the Brackets editor to ignore any directory you include in there, but you'll have to give it a try to be sure.

0 Kudos
Adrian_G_
Beginner
1,743 Views

So I tried "node_modules" and "node_modules/*", but no change in behavior.

0 Kudos
Adrian_G_
Beginner
1,743 Views

I came across this, https://github.com/adobe/brackets/wiki/Large-Projects, on the Backets editor.  Do you think you can add the exclude folders extension in the next build, https://github.com/gruehle/exclude-folders?

0 Kudos
PaulF_IntelCorp
Employee
1,743 Views

Excellent idea! :) I'll make that request. In the meantime, there is a way to shoehorn extensions into the embedded Brackets editor (it doesn't work for all, but this one is simple enough it should work).

  • exit the XDK
  • download the extension (https://github.com/gruehle/exclude-folders/archive/master.zip)
  • on Windows, unzip it to here: %LocalAppData%\Intel\XDK\xdk\brackets\b\extensions\dev
  • on Mac OSX unzip it to here: /Applications/Intel\ XDK.app/Contents/Resources/app.nw/brackets/b/extensions/dev
  • start the XDK

The extension should now be installed (check under File > Extension Manager...)

Since that extension has no UI, you'll have to change it to meet your needs, according to the instructions he provides in his repo.

0 Kudos
Adrian_G_
Beginner
1,743 Views

Paul,

Great suggestion.  I'm unblocked now.  Many thanks!!

Adrian

0 Kudos
PaulF_IntelCorp
Employee
1,743 Views

p.s. You may have to go through this with each new install/update to the XDK, so don't lose these instructions! :)

0 Kudos
Adrian_G_
Beginner
1,743 Views

Hey Paul,

I upgraded to 2366 because I could not build for ios in the previous version.  Now XDK is locking up again for me.  I've added the exclude extension for brackets editor.  I think somewhere else in the XDK is scanning the node_modules directory.

Adrian

0 Kudos
PaulF_IntelCorp
Employee
1,743 Views

Not sure what to tell you other than don't use the Develop tab and just use an external editor. You can download and install Brackets locally on your machine and just edit the files using that version of Brackets. Then use the other tabs to do your debugging and building. Here's a link to the Brackets main page: http://brackets.io/

We are upgrading Brackets to 1.4 in the next major release and including a similar extension.

0 Kudos
Reply