You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't build NodeJS projects on Linux with the dotnet sdk #2335
When you build a solution on a linux machine, you'll get:
/*********.njsproj(98,3): error MSB4019: The imported project "/usr/share/dotnet/sdk/3.1.409/Microsoft/VisualStudio/v16.0/Node.js Tools/Microsoft.NodejsToolsV2.targets" was not found. Confirm that the expression in the Import declaration "/usr/share/dotnet/sdk/3.1.409/Microsoft/VisualStudio/v16.0/Node.js Tools/Microsoft.NodejsToolsV2.targets" is correct, and that the file exists on disk.
So the .Net Core SDK doesn't contain the target files for NodeJS. I haven't seen any tools for installing these files on a Linux build server.
This is still a problem, and it happens in windows too. Steps to reproduce:
Observed Behavior
Install the latest 5.0.9 .net SDK.
Install Node 14 LTS.
Install a fresh copy of Visual Stu
Open Visual Studio 2019 community edition.
Create a new visual studio solution, with a Blank Node.js console application, named NodejsConsoleApp1.
Open a console and navigate to the root folder of NodejsConsoleApp1.
Type 'dotnet build'.
Result was:
C:\Users\me\source\repos\NodejsConsoleApp1> dotnet build
Microsoft (R) Build Engine version 16.11.0+0538acc04 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Users\me\source\repos\NodejsConsoleApp1\NodejsConsoleApp1\NodejsConsoleApp1.njsproj : warning NU1503: Skipping restore for project 'C:\Users\me\source\repos\NodejsConsoleApp1\NodejsConsoleApp1\NodejsConsoleApp1.njsproj'. The project file may be invalid or missing targets required for restore. [C:\Users\me\source\repos\NodejsConsoleApp1\NodejsConsoleApp1.sln]
Determining projects to restore...
C:\Program Files\dotnet\sdk\5.0.400\NuGet.targets(131,5): warning : Unable to find a project to restore! [C:\Users\me\source\repos\NodejsConsoleApp1\NodejsConsoleApp1.sln]
C:\Users\me\source\repos\NodejsConsoleApp1\NodejsConsoleApp1\NodejsConsoleApp1.njsproj(35,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\5.0.400\Microsoft\VisualStudio\v16.0\Node.js Tools\Microsoft.NodejsToolsV2.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\sdk\5.0.400\Microsoft\VisualStudio\v16.0\Node.js Tools\Microsoft.NodejsToolsV2.targets" is correct, and that the file exists on disk.
Build FAILED.
C:\Users\me\source\repos\NodejsConsoleApp1\NodejsConsoleApp1\NodejsConsoleApp1.njsproj : warning NU1503: Skipping restore for project 'C:\Users\me\source\repos\NodejsConsoleApp1\NodejsConsoleApp1\NodejsConsoleApp1.njsproj'. The project file may be invalid or missing targets required for restore. [C:\Users\me\source\repos\NodejsConsoleApp1\NodejsConsoleApp1.sln]
C:\Program Files\dotnet\sdk\5.0.400\NuGet.targets(131,5): warning : Unable to find a project to restore! [C:\Users\me\source\repos\NodejsConsoleApp1\NodejsConsoleApp1.sln]
C:\Users\me\source\repos\NodejsConsoleApp1\NodejsConsoleApp1\NodejsConsoleApp1.njsproj(35,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\5.0.400\Microsoft\VisualStudio\v16.0\Node.js Tools\Microsoft.NodejsToolsV2.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\sdk\5.0.400\Microsoft\VisualStudio\v16.0\Node.js Tools\Microsoft.NodejsToolsV2.targets" is correct, and that the file exists on disk.
2 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.24
C:\Users\me\source\repos\NodejsConsoleApp1>
Desired Behavior
This is in contrast to doing this within visual studio, building the app (ctrl+shift+b or right click->build) allow the application to build without error:
Activity
RobertPepkaSEL commentedon Sep 4, 2021
This is still a problem, and it happens in windows too. Steps to reproduce:
Observed Behavior
Result was:
Desired Behavior
This is in contrast to doing this within visual studio, building the app (ctrl+shift+b or right click->build) allow the application to build without error:
JessicaMulein commentedon May 12, 2022
having a similar issue...