title: 'The command "npm install" exited with code 1' error when building an ASP.NET Core app with React on macOS
body: <p>I'm creating a React.js app with asp.net core on mac OS 12.0.1,
  I'm trying to build and run this app after initial settings:</p>
  <p><a href="https://i.stack.imgur.com/ntmmu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ntmmu.png" alt="enter image description here" /></a></p>
  <p>but then I get this error:</p>
  <blockquote>
  <p>/Users/user/Projects/NameProject/NameProject/NameProject.csproj(5,5):Error
  MSB3073: The command &quot;npm install&quot; exited with code 1. (MSB3073)</p>
  </blockquote>
  <p>Here are my logs:</p>
  <pre><code>Building ReactReduxNetTest (Debug)
  Build started 11/18/2021 10:56:27 AM.
  __________________________________________________
  Project &quot;/Users/user/Projects/ReactReduxNetTest/ReactReduxNetTest/ReactReduxNetTest.csproj&quot; (Build target(s)):
  
  Target GenerateTargetFrameworkMonikerAttribute:
    Skipping target &quot;GenerateTargetFrameworkMonikerAttribute&quot; because all output files are up-to-date with respect to the input files.
  Target CoreGenerateAssemblyInfo:
    Skipping target &quot;CoreGenerateAssemblyInfo&quot; because all output files are up-to-date with respect to the input files.
  Target _DiscoverMvcApplicationParts:
    Skipping target &quot;_DiscoverMvcApplicationParts&quot; because all output files are up-to-date with respect to the input files.
  Target _CoreGenerateRazorAssemblyInfo:
    Skipping target &quot;_CoreGenerateRazorAssemblyInfo&quot; because all output files are up-to-date with respect to the input files.
  Target CoreCompile:
    Skipping target &quot;CoreCompile&quot; because all output files are up-to-date with respect to the input files.
  Target GenerateStaticWebAssetsManifest:
    Skipping target &quot;GenerateStaticWebAssetsManifest&quot; because all output files are up-to-date with respect to the input files.
  Target _GenerateScopedCssFiles:
    Skipping target &quot;_GenerateScopedCssFiles&quot; because it has no outputs.
  Target ResolveTagHelperRazorGenerateInputs:
    Skipping target &quot;ResolveTagHelperRazorGenerateInputs&quot; because all output files are up-to-date with respect to the input files.
  Target RazorCoreGenerate:
    Skipping target &quot;RazorCoreGenerate&quot; because all output files are up-to-date with respect to the input files.
  Target CoreGenerateRazorTargetAssemblyInfo:
    Skipping target &quot;CoreGenerateRazorTargetAssemblyInfo&quot; because all output files are up-to-date with respect to the input files.
  Target RazorCoreCompile:
    Skipping target &quot;RazorCoreCompile&quot; because all output files are up-to-date with respect to the input files.
  Target _CopyFilesMarkedCopyLocal:
      Touching &quot;/Users/user/Projects/ReactReduxNetTest/ReactReduxNetTest/obj/Debug/net5.0/ReactReduxNetTest.csproj.CopyComplete&quot;.
  Target _CopyOutOfDateSourceItemsToOutputDirectory:
    Skipping target &quot;_CopyOutOfDateSourceItemsToOutputDirectory&quot; because all output files are up-to-date with respect to the input files.
  Target GenerateBuildDependencyFile:
    Skipping target &quot;GenerateBuildDependencyFile&quot; because all output files are up-to-date with respect to the input files.
  Target GenerateBuildRuntimeConfigurationFiles:
    Skipping target &quot;GenerateBuildRuntimeConfigurationFiles&quot; because all output files are up-to-date with respect to the input files.
  Target CopyFilesToOutputDirectory:
      ReactReduxNetTest -&gt; /Users/user/Projects/ReactReduxNetTest/ReactReduxNetTest/bin/Debug/net5.0/ReactReduxNetTest.dll
  Target _RazorCopyFilesToOutputDirectory:
      ReactReduxNetTest -&gt; /Users/user/Projects/ReactReduxNetTest/ReactReduxNetTest/bin/Debug/net5.0/ReactReduxNetTest.Views.dll
      Touching &quot;/Users/user/Projects/ReactReduxNetTest/ReactReduxNetTest/obj/Debug/net5.0/ReactReduxNetTest.csproj.CopyComplete&quot;.
  Target DebugEnsureNodeEnv:
      node --version
      v12.16.1
      Restoring dependencies using 'npm'. This may take several minutes...
      npm install
      npm ERR! code EJSONPARSE
      npm ERR! file /Users/user/Projects/ReactReduxNetTest/ReactReduxNetTest/ClientApp/package.json
      npm ERR! JSON.parse Failed to parse json
      npm ERR! JSON.parse Unexpected token } in JSON at position 1528 while parsing near '...sh&quot;: &quot;&gt;=4.17.21&quot;,
      npm ERR! JSON.parse   },
      npm ERR! JSON.parse   &quot;browserslist&quot;:...'
      npm ERR! JSON.parse Failed to parse package.json data.
      npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
      
      npm ERR! A complete log of this run can be found in:
      npm ERR!     /Users/user/.npm/_logs/2021-11-18T14_56_28_644Z-debug.log
      /Users/user/Projects/ReactReduxNetTest/ReactReduxNetTest/ReactReduxNetTest.csproj(30,5): error MSB3073: The command &quot;npm install&quot; exited with code 1.
  Done building target &quot;DebugEnsureNodeEnv&quot; in project &quot;ReactReduxNetTest.csproj&quot; -- FAILED.
  
  Done building project &quot;ReactReduxNetTest.csproj&quot; -- FAILED.
  
  Build FAILED.
  
  /Users/user/Projects/ReactReduxNetTest/ReactReduxNetTest/ReactReduxNetTest.csproj(30,5): error MSB3073: The command &quot;npm install&quot; exited with code 1.
      0 Warning(s)
      1 Error(s)
  
  Time Elapsed 00:00:01.03
  
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  
  Build: 1 error, 0 warnings
  
  </code></pre>