Reputation:
Is there any configuration that i can set so that node tools does not slow down visual studio? I cant uninstall node tools because i need to use it , but it slows down vs a heck of a lot and just opening up the properties window for a project becomes very painful.
I have tried to hide the node_modules folder thinking that maybe it was trying to read those files, but that did not change anything.
any suggestions? Thanks
Upvotes: 5
Views: 2040
Reputation: 85
I just have removed all content of external folder. In my case it is:
X:\Program Files (x86)\Microsoft Visual Studio\2017{Version}\Web\External)
Before that i have decided that it is TFS (because of geographically TFS server locates to far from me: internet, firewalls etc)- after each modification in solution i have waiting for min 15sec (during them visual studio was blocked, did not respond).
But now, when node.js and other external content was removed - almost two days i can work without any delay. I know node.js itself should works ok - but i didn't touch it, it works as it setup by default, and look like that have to be improved ;).
Upvotes: 0
Reputation: 917
It's been almost more than one year, vs2017 got released, but the situation is still the same. I have strong suspects that the VS does not respect AnalysisIgnoredDirectories
property, or performs a deep scan of changed files (after each gulp/npm build).
And we're not alone in this, check this thread: https://github.com/Microsoft/nodejstools/issues/1506
I'll update this topic when I receive further information from Microsoft. Until then, yeah we're gonna stick to plain notepad.exe.
Upvotes: 0
Reputation: 4401
You say you can't uninstall node tools, but ultimately, I had to uninstall Node Tools before I could get a usable Visual Studio. With default settings and Node Tools installed, Visual Studio auto install package.json, then auto-analyzes those files in an attempt to create code-hinting intellisense, Node tools would create a remarkably large .ntvs_analysis.dat cache file. After all this forced setup and analysis, if I didn't CTRL-ALT-DEL my way out of a 5-30 min freeze, it would work for a few minutes before crashing again. I’d see a spike in memory and cpu usage until my laptop would freeze, and the .ntvs_analysis file only got larger. It took me a while to realize I could still use and make node projects without Node Tools.
npm install
at the location of your package.json folder.This workaround still makes it challenging to work in TFS in the way our team files are organized.
If, as you say, you must have node tools, turn off other plugins, turn off intellisense, at that point, after following my own advice, I realized I was better off with notepad (arg!).
You could ignore certain directories for analysis--
A quote from https://github.com/Microsoft/nodejstools/wiki/Projects#ignoring-directories-for-analysis :
It may be useful to ignore certain directories, such as client side JavaScript, from analysis. There are many reasons to do this but the biggest two are:
- the particular directory is large and takes a great deal of time to analyse.
- The directory contains client side code that doesn't need to be analysed.
There is a property in the .njsproj file that can be used to ignore directories. The following code can be added to the project file under a PropertyGroup:
<PropertyGroup> <!-- Specifies the directories which are ignored. Any paths which contain these directory names will be ignored. The directory name must completely match and no wild cards are allowed --> <AnalysisIgnoredDirectories>bower_components;dir_not_included</AnalysisIgnoredDirectories> </PropertyGroup>
Note that all filepaths containing the specified string will be ignored. So if you specify dir_not_included, every filepath containing dir_not_included will be ignored (including subdirectories).
This property takes precedence over other settings. This includes whether you included the file in your project or not. If you specify a directory here as ignore it will not be analysed.
You are not the only developer to scratch their head over this, for all of Microsoft's advertising node.js support, the support is very thin, if some very smart people in my team and I find themselves fighting Visual Studio when using node projects.
I hope someone has a better answer than mine, because I'm also interested in a better solution.
Upvotes: 2