Skip to content
Paul van Brenk edited this page Dec 12, 2017 · 18 revisions

🎵Note: This documentation is outdated at this point, especially when using the Node tools in Visual Studio 2017. We're working on update docs, and will redirect you to those when they're ready.

Why am I getting errors when running my node project in VS that do not occur when running from the command line?

It is possible that nodejstools is using a different copy/version of node.js to the command line. Check the project properties "node.exe path" and modify if necessary. For example nodejstools may default to "C:\Program Files (x86)\nodejs\node.exe" when you have installed a 64 bit version in "C:\Program Files\nodejs\node.exe".

How does Nodejstools depend on Nodejs and npm versions?

  • The path to the node used at run-time is specified in the project preferences (right click project in solution explorer).
  • For basic editing and intellisense node and npm do not need to be installed at all.
  • You will be warned if you use a feature requiring either and they cannot be found (they are searched for in project settings and then the environment).
  • Some extensions like Web Analyzer() and options like the npm integration currently use Visual Studio private versions of Node and npm which are fixed (you might be able to drop in a newer version).
  • The intellisense is for ES5 but you can switch on experimental ES6 support if you use the ES6 features available in node(.
  • The latest versions of node have been tested for breaking changes as described in the manual test matrix.

Why are the my editor settings such as use spaces for tabs not being followed?

nodejs has it's own setting in the editor language options and does not use the javascript settings. Settings defined with the EditorConfig extension will be applied.

Can I use multiple versions of node and switch between them?

Yes. Use a node version manager such as nvm-windows. You can also specify the node location in the project settings.

What dependencies does using nodejstools introduce to my code?

Almost none. Apart from the usual Visual Studio solution and project files, which you'll probably want to ap to version control, other files are generated when required. In fact, the import existing code option means the solution and project files can also be generated on demand. Thus, VisualStudio + nodejstool can simply use your existing files and command line workflow. Alternatively, various VisualStudio extensions can be used to ap workflow functionality such as linting.

What .gitignore file should I use?

You can use this VisualStudio file that will cause git to ignore node_modules and nodejstools temporary files. You might also like to include this node.js file as well.