How-to-simply...

Install .NET 8 SDK and NodeJS 14 on TeamCity Windows Server 2008 R2

  • 1 Download specific NodeJS version:
    v14.16.1 v14.17.6 v15.8.0 v16.6.2
  • 2 Replace contents of the node directory with a new version of NodeJS
    set "nodeDir=%ProgramFiles%\node"
    set "nodeBackup=%ProgramFiles%\node_bak"
    if not exist "%nodeBackup%" mkdir "%nodeBackup%"
    move /Y "%nodeDir%" "%nodeBackup%"
    powershell Expand-Archive -Path "C:\path\to\node-v14.16.1.zip" -DestinationPath "%nodeDir%"
  • 3 Add system environment variable
    setx NODE_SKIP_PLATFORM_CHECK 1 /m
  • 4 Download and install latest .NET 8 SDK, tested with v8.0.200
  • 5 Update or set MSBuildSDKsPath system environment variable used by TC
    setx MSBuildSDKsPath %ProgramFiles%\dotnet\sdk\8.0.200\Sdks\ /m
  • N NODE_SKIP_PLATFORM_CHECK may also work with a specific more recent release like v16.6.2. Preferably use latest version of .NET SDK as it may contain security fixes and improvements. Using EOL Windows versions is discouraged, there are no guarantees it will operate correctly. Using outdated NodeJS version may pose significant security risks.

References