VS Code Javascript Intellisense Loading Forever
Published 2020-01-09
Photo by Charles on Unsplash
I was coding on a side project when I realized my Javascript intellisense wasn't working. Loading...
would pop up for autocomplete and it would just spin forever. I found some possible solutions mentioned in GitHub tickets about some VS Code extensions being the culprit, namely Debugger For Chrome. After trying what felt like LITERALLY everything I gave up and just dealt with not having intellisense for Javascript for until I couldn't take it anymore.
The Problem
VS Code intellisense Loading...
forever on some NPM modules.
The Solution
The solution came to me much later when I was looking at output from npm install -g ...
.
I have two storage drives in my PC: one small solid state and one large hard drive. My OS and some other programs that need the solid state speed end up on the SDD while my workspace where all my projects go end up on the HDD.
I noticed that npm install -g ...
(global) would install to my solid state, but I had a project opened in VS Code that was saved to my hard drive where intellisense was broken. Hmmm...
I moved my workspace over to my solid state, reopened my project up in VS Code and it worked! No more intellisense loading forever, everything was nice and snappy.
I suppose I could have done it the other way and moved my default npm
install directory over to my hard drive had similar success. To do this, edit the npmrc
file and change the prefix value to the other drive:
$ pwd
/d/Program Files/nodejs/node_modules/npm
$ cat npmrc
prefix=${APPDATA}\npm
#vs-code#javascript