I am trying to setup Visual studio 2019 for .Net development with Vue.js in a M1 pro mac arm64. I have a starter code that my team member provided. They use a window machine and they are running it without issue. However, when I try to build the project I keep getting an error saying that Node was not installed. Error in visual studio
I am pretty sure I installed it because I regularly use to run React apps. It is running in the intel mode right now but it gives the same response for the arm64 mode as well. I would like to point out that I have used nvm to install my node package. This is my console output in the terminal for vscode:
prabalchhatkuli@Prabals-MacBook-Pro TimeTracking % node --version
v14.17.5
prabalchhatkuli@Prabals-MacBook-Pro TimeTracking % which node
/Users/prabalchhatkuli/.nvm/versions/node/v14.17.5/bin/node
prabalchhatkuli@Prabals-MacBook-Pro TimeTracking % arch
i386
prabalchhatkuli@Prabals-MacBook-Pro TimeTracking %
And I am trying to run this part of the .csproj file:
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
<!-- Ensure Node.js is installed -->
<Exec Command="node --version" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
</Exec>
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
<Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
</Target>
I don't have an explanation for this because the node --version works in the rosetta2 terminal as well as the native terminal.