Build:Cannot find type definition file for 'node'

In my case, I solved my problem. Hopefully it helps some else later.

npm install @types/node --save-dev

I had several problems updating packages through visual studio. From now i always update or add packages with the powershell console.

Start PowerShell and navigate to the folder where package.json is located and then run npm install Restart visual studio after the installation is done.

You can also try to delete your node_modules folder then run npm install

Hope this will solve your problems.


For local Visual Studio

If you're starting with a clean template the build in VS functionality should probably work!

Go to Dependencies > npm > Right Click > Restore Packages

Then try build again.

For Visual Studio Team Services

  • Install node https://nodejs.org/en/download/

  • Restart your agent service (VSTS Agent) if not using hosted agents

  • Add a build task to run npm install

  • Click the menu icon next to 'Working folder' to choose the location where your project.json file is located.

    enter code here