Intellisense problems with node.js development with Visual Studio 2017 - node.js

Usually we're in a microsoft stack development but for the project purposes we need to develop in node.js in visual studio 2017.
There are some things we don't understand at all but are quite annoying.
We've installed node.js tools for Visual Studio 2017 but intellisense work for some things and doesn't for others.
2 main problems we're facing:
For example, for some node modules (router, express, etc...) intellisense works fine. For others (mongorito, for examlple, but its not mongorito specific, there are many others also) we don't get any intellisense nor we can navigate through its definitions ('go to definition').
For any file we open we get alot of TSxxx error messages. something like this:
Don't know if its important but with the same setup we had our team members to work on angular 2/4 projects (that use node modules, of course) and everything worked fine.
So, if anyone has a piece of advice we would highly appreciate it. And please explain it like for a complete idiots.
PS.
Don't know if its important, but i must say that solution builds, all tests are good and all runs as it should. Its IDE problem.

So, for everyone having the problem i'll post the solution here.
Problem was in typescript version. Now, that comes with a few details.
In Visual studio pre 15.2 you can't have typescript versions switching. So, i first updated VS to 15.2.
After that, i've installed Typescript SDK with latest typescript (2.4.1. i think at the moment).
Then go to Tools > Options > TextEditor > Javascript/Typescript > Intellisense > Here choose typescript version from the drop down.
[I'll leave answer unaccepted for a bit for the case someone comes with a better solution]

Related

Where is the typescript build option in VS 2019 Community?

On VS 2015 when I created a blank node.js web app, if I right click on the project and selected its properties, there was a tab on the left that read "TYPESCRIPT BUILD"
This allowed me to use certain options like "combine javascript output into a file" and so on.
I then upgraded to VS 2019 Community as well, and cannot find the "Typescript Build" equivalent for the life of me.
Can anyone point in the right direction as to where this is currently placed?
Eventually I gave up and went to VS Code, where all the love for Typescript seems to be nowadays. Not really an answer, but it seems if you wish to have specialized build options, go through the route of directly (and manually) configuring the associated tsconfig.json file

Visual Studio Code does not suggest any Node.js syntax

I am new to visual studio code and Node.js and also install Node and npm to my computer.
My problem is VS code does not suggest any node syantax.
I watch youtube tutorials to learn node and in the video, instructors VS code suggest node js syntax.
Based on: https://code.visualstudio.com/docs/editor/intellisense it should have intellisense come right out of the box within VS code. I would recommend uninstalling and reinstalling VS code.
Some other gotcha's or things which may help:
Intellisense for javascript only works within files that are labeled with the .js extension
The hotkey Ctrl+Shift+brings up a terminal which contains aProblems` in there you can see the problems of the Workspace which may show some additional information regarding what is failing.

Visual Studio 2015 - Multiple Instances of Node.js

I am currently experiencing a strange issue with Node.js within Visual Studio.
I'm currently working on multiple projects (containing many typescript files - i've read elsewhere this could possibly have something to do with my problem) in Visual Studio 2015 (Version 4.7.02053). I have node.js (v 6.10.0) installed on my dev machine also. Currently we are using the built in TypeScript compiler within visual studio (previously using grunt for ts compilation, now just for sass).
I've also configured visual studio to use the current version of node I have installed (please see screenshot below):
Custom Path to node.js installation
My issue is this, whenever I open one of my projects, multiple, I mean a lot, I mean like between 50-100 node.exe processes spin up, please see the image below!
Lot's of node processes, seems to be update-notifier\check.js???
This is eating away at my CPU and rendering my machine barely usable, especially when i have three or four separate projects open at the same time.
I've attempted to google a fix for this but haven't come up with anything that has worked thus far, so, any help you could possibly give me is greatly appreciated.
Thanks in advance,
Paul
This seems to have to do with the update-notifier package.

Can I use ES6 modules in a Node.js application and debug it in Visual Studio?

I've tried building a basic node.js ES6 module test project in Visual Studio 2015. But I get build errors and cannot run or debug the application in VS.
Have I just came to the party too early?
If it's worth anything I have tried opening and building the project in both VS2013 (Update 3) and VS2015 RC.
I have installed:
Node.js 0.12.2
Node.js Tools 1.0 for VS2013
Node.js Tools 1.1 Beta for VS2015
Additionally, I have added Robert Penners () node.d.ts gist to get over the import syntax errors.
See: https://gist.github.com/robertpenner/7d48f184df1236c4fdca
I have uploaded the project for others to try: https://dl.dropboxusercontent.com/u/10159140/es6-modules-ts.zip
Node Tools dev here. Thanks for reporting this. Indeed, we support the ES6 typescript target type.
That said, I'm running into issues running your app in the command line altogether with the latest versions of both node and io.js, so this may be a level of ES6 support mismatch between all the components at play here... Have you managed to successfully run your app in the command line (without the debugger)? Otherwise it may be related to this discussion:
https://github.com/nodejs/io.js/issues/1000
Once you figure that out, be sure to set up your project with the right node.exe arguments (harmony flag and whatnot) in project properties, so Visual Studio knows how to run it too.
Hope that helps!
P.S. just an fyi - we've moved to GitHub now, so please post issues there (rather than on CodePlex) for the quickest responses.
https://github.com/Microsoft/nodejstools

Does CodeBlocks corrupt Dev studio projects?

I am at a new company and they use 2012 Dev Studio express. I would like to use CodeBlocks as the limitations on Express are frustrating.
Assuming I use the MS compiler does CodeBlocks corrupt anything in the Dev studio project structure? Other developers will be working on the same code (via GIT) so I need to make sure that there are no side effects which might effect them.
As far as I am aware there should be no major side effects, maybe a IDE specifics if you're not careful. My group has used Dev (and Visual) Studio Express and CodeBlocks on the same project and it was perfectly fine.
So I doubt there will be any corruption.

Resources