fullstackproltd / AspNetCoreSpa

Asp.Net 7.0 & Angular 15 SPA Fullstack application with plenty of examples. Live demo:
https://aspnetcorespa.fullstackpro.co.uk
MIT License
1.47k stars 464 forks source link

Cannot get File Publish to work #110

Closed Azayzel closed 7 years ago

Azayzel commented 7 years ago

I can't seem to get File Publish to build successfully. An ideas? I can't figure out what comes after this bit to try to resolve it.

** I am using VS 2017

    TS7017: Element implicitly has an 'any' type because type 'Icons' has no index signature.
  Child extract-text-webpack-plugin:
         [0] ./~/css-loader/lib/css-base.js 2.19 kB {0} [built]
         [1] ./~/css-loader!./~/bootstrap/dist/css/bootstrap.css 201 kB {0} [built]
         [2] ./~/css-loader!./~/font-awesome/css/font-awesome.css 42 kB {0} [built]
         [3] ./~/base64-js/index.js 3.48 kB {0} [built]
         [4] ./~/buffer/index.js 48.6 kB {0} [built]
         [5] ./~/css-loader!./Client/styles/vendor.css 1.97 kB {0} [built]
         [6] ./~/font-awesome/fonts/fontawesome-webfont.eot 82 bytes {0} [built]
         [7] ./~/font-awesome/fonts/fontawesome-webfont.eot?v=4.7.0 82 bytes {0} [built]
         [8] ./~/font-awesome/fonts/fontawesome-webfont.svg?v=4.7.0 82 bytes {0} [built]
         [9] ./~/font-awesome/fonts/fontawesome-webfont.ttf?v=4.7.0 82 bytes {0} [built]
        [10] ./~/font-awesome/fonts/fontawesome-webfont.woff2?v=4.7.0 84 bytes {0} [built]
        [11] ./~/font-awesome/fonts/fontawesome-webfont.woff?v=4.7.0 83 bytes {0} [built]
        [12] ./~/ieee754/index.js 2.05 kB {0} [built]
        [13] ./~/isarray/index.js 132 bytes {0} [built]
        [14] (webpack)/buildin/global.js 509 bytes {0} [built]
  Webpack Bundle Analyzer saved report to C:\NEW_StudentLock_Core\AspNetCoreSpa\wwwroot\dist\report.html

  npm ERR! Windows_NT 10.0.14393
  npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\Azayzel\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build:prod"
  npm ERR! node v6.6.0
  npm ERR! npm  v3.10.7
  npm ERR! code ELIFECYCLE
  npm ERR! aspnetnetcore@0.0.0 build:prod: `node node_modules/webpack/bin/webpack.js --config config/webpack.prod.js --env.prod`
  npm ERR! Exit status 2
  npm ERR! 
  npm ERR! Failed at the aspnetnetcore@0.0.0 build:prod script 'node node_modules/webpack/bin/webpack.js --config config/webpack.prod.js --env.prod'.
  npm ERR! Make sure you have the latest version of node.js and npm installed.
  npm ERR! If you do, this is most likely a problem with the aspnetnetcore package,
  npm ERR! not with npm itself.
  npm ERR! Tell the author that this fails on your system:
  npm ERR!     node node_modules/webpack/bin/webpack.js --config config/webpack.prod.js --env.prod
  npm ERR! You can get information on how to open an issue for this project with:
  npm ERR!     npm bugs aspnetnetcore
  npm ERR! Or if that isn't available, you can get their info via:
  npm ERR!     npm owner ls aspnetnetcore
  npm ERR! There is likely additional logging output above.

  npm ERR! Please include the following file with any support request:
  npm ERR!     C:\NEW_StudentLock_Core\AspNetCoreSpa\npm-debug.log
C:\NEW_StudentLock_Core\AspNetCoreSpa\StudentLock.csproj(23,5): error MSB3073: The command "npm run build:prod" exited with code 1.
Azayzel commented 7 years ago

right now I am stuck on deployment. I've tried every possible solution and I end up with the above result.

My debug.log

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files (x86)\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\Azayzel\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build:prod' ]
2 info using npm@4.6.1
3 info using node@v6.6.0
4 verbose run-script [ 'prebuild:prod', 'build:prod', 'postbuild:prod' ]
5 info lifecycle aspnetnetcore@0.0.0~prebuild:prod: aspnetnetcore@0.0.0
6 silly lifecycle aspnetnetcore@0.0.0~prebuild:prod: no script for prebuild:prod, continuing
7 info lifecycle aspnetnetcore@0.0.0~build:prod: aspnetnetcore@0.0.0
8 verbose lifecycle aspnetnetcore@0.0.0~build:prod: unsafe-perm in lifecycle true
9 verbose lifecycle aspnetnetcore@0.0.0~build:prod: PATH: C:\Users\Azayzel\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\NEW_StudentLock_Core\AspNetCoreSpa\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Common Files\Lenovo;C:\ProgramData\Lenovo\ReadyApps;C:\Program Files (x86)\Common Files\lenovo\easyplussdk\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\nodejs\;C:\Go\bin;c:\Go;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft Emulator Manager\1.0\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Users\Azayzel\AppData\Local\Microsoft\WindowsApps;c:\python27\python.exe;C:\Users\Azayzel\AppData\Roaming\npm;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\Azayzel\.nuget\packages\newtonsoft.json\10.0.2\tools;C:\Users\Azayzel\.nuget\packages\microsoft.bcl.build\1.0.14\tools;C:\Users\Azayzel\.nuget\packages\microsoft.codeanalysis.analyzers\1.1.0\tools;C:\Users\Azayzel\.nuget\packages\microsoft.entityframeworkcore.tools\1.1.0\tools
10 verbose lifecycle aspnetnetcore@0.0.0~build:prod: CWD: C:\+++Core\AspNetCoreSpa
11 silly lifecycle aspnetnetcore@0.0.0~build:prod: Args: [ '/d /s /c',
11 silly lifecycle   'node node_modules/webpack/bin/webpack.js --config config/webpack.prod.js --env.prod' ]
12 silly lifecycle aspnetnetcore@0.0.0~build:prod: Returned: code: 2  signal: null
13 info lifecycle aspnetnetcore@0.0.0~build:prod: Failed to exec build:prod script
14 verbose stack Error: aspnetnetcore@0.0.0 build:prod: `node node_modules/webpack/bin/webpack.js --config config/webpack.prod.js --env.prod`
14 verbose stack Exit status 2
14 verbose stack     at EventEmitter.<anonymous> (C:\Users\Azayzel\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Users\Azayzel\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:877:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid aspnetnetcore@0.0.0
16 verbose cwd C:\++\AspNetCoreSpa
17 verbose Windows_NT 10.0.14393
18 verbose argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\Azayzel\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build:prod"
19 verbose node v6.6.0
20 verbose npm  v4.6.1
21 error code ELIFECYCLE
22 error errno 2
23 error aspnetnetcore@0.0.0 build:prod: `node node_modules/webpack/bin/webpack.js --config config/webpack.prod.js --env.prod`
23 error Exit status 2
24 error Failed at the aspnetnetcore@0.0.0 build:prod script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 2, true ]
Azayzel commented 7 years ago

It's definately a problem with the webpack configs. When run publish with this .csproj, everything builds fine

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp1.1</TargetFramework>
    <DebugType>portable</DebugType>
    <PreserveCompilationContext>true</PreserveCompilationContext>
    <AssemblyName>AspNetCoreSpa</AssemblyName>
    <OutputType>Exe</OutputType>
    <PackageId>AspNetCoreSpa</PackageId>
    <UserSecretsId>aspnetcorespa-c23d27a4-eb88-4b18-9b77-2a93f3b15119</UserSecretsId>
    <RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
    <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
    <PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
  </PropertyGroup>

 <!-- <ItemGroup>
    <Compile Remove="node_modules\**\*;Client\**\*" />
    <Content Remove="wwwroot\dist\**\*" />
  </ItemGroup>  

  <Target Name="RunWebpack" BeforeTargets="BeforePublish">
    <Exec Command="npm run clean:dist" />
    <Exec Command="npm run build:prod" />
    <ItemGroup>
      <DistFiles Include="wwwroot\dist\**\*" />
      <Content Include="@(DistFiles)" CopytoPublishDirectory="Always" />
      <Content Include="app.yaml" CopyToOutputDirectory="Always" />
      <ContentWithTargetPath Include="@(DistFiles)" TargetPath="%(Identity)" CopyToPublishDirectory="Always" />
    </ItemGroup>
  </Target>-->

  <ItemGroup>
    <PackageReference Include="AspNet.Security.OAuth.Introspection" Version="1.0.0" />
    <PackageReference Include="AspNet.Security.OAuth.Validation" Version="1.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.AzureAppServicesIntegration" Version="1.0.1" />
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
    <PackageReference Include="Microsoft.AspNetCore.Cors" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Antiforgery" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Authorization" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.Twitter" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Https" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" />
    <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.ResponseCompression" Version="1.0.1" />
    <PackageReference Include="Microsoft.AspNetCore.WebSockets" Version="1.0.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="1.1.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.1" />
    <PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="1.1.1" />
    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.1" />
    <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="1.1.1" />
    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.1" />
    <PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.1" />
    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.AngularServices" Version="1.1.0-beta-000002" />
    <PackageReference Include="AspNet.Security.OAuth.GitHub" Version="1.0.0-beta3-final" />
    <PackageReference Include="AspNet.Security.OAuth.LinkedIn" Version="1.0.0-beta3-final" />
    <PackageReference Include="OpenIddict" Version="1.0.0-*" />
    <PackageReference Include="OpenIddict.EntityFrameworkCore" Version="1.0.0-*" />
    <PackageReference Include="OpenIddict.Mvc" Version="1.0.0-*" />
    <PackageReference Include="RestSharp.NetCore" Version="105.2.3" />
    <PackageReference Include="SendGrid.NetCore" Version="1.0.0-rtm-00002" />
    <PackageReference Include="MailKit" Version="1.14.2" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0-rc3" />
    <PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="1.0.0-rc3" />
    <PackageReference Include="Twilio" Version="5.3.0" />
    <PackageReference Include="Stripe.net" Version="8.1.1" />
    <PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
    <PackageReference Include="Webpack" Version="4.0.0" />
    <PackageReference Include="Serilog" Version="2.4.1-dev-00801" />
    <PackageReference Include="Serilog.Extensions.Logging" Version="1.4.1-dev-10147" />
    <PackageReference Include="Serilog.Sinks.Seq" Version="3.2.0" />
    <PackageReference Include="Bogus" Version="15.0.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.1.0">
      <PrivateAssets>All</PrivateAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="1.1.0">
      <PrivateAssets>All</PrivateAssets>
    </PackageReference>
  </ItemGroup>

  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="1.0.0" />
    <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.0" />
    <DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="1.0.0" />
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" />
  </ItemGroup>

</Project>
crh225 commented 7 years ago

What version of node/npm/typescript is installed on your machine?

Azayzel commented 7 years ago

Node: v6.6.0 TS: Version 2.3.0-dev.20170303 NPM: 4.6.1

It builds perfect when running in development, which leads me to believe its a webpack.prod issue. When i comment out the above lines; it builds perfect.

Azayzel commented 7 years ago

Is anyone else able to publish via File Publish? I grabbed a fresh copy of the project and still was not able to.

kiwiingenuity commented 7 years ago

I just tried the following:

  1. Cloned the repository
  2. cd aspnetcorespa
  3. dotnet restore
  4. npm install
  5. dotnet publish 6 cd bin\debug\netcoreapp1.1\publish 7 dotnet aspnetcorespa.dll

All worked as expected!

Azayzel commented 7 years ago

maybe becuase my TS verison is ahead of the packages? Ill try to uninstall and re-install 2.2.2

Azayzel commented 7 years ago

Tried the above and i still get the below..

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files (x86)\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\Azayzel\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build:prod' ]
2 info using npm@4.6.1
3 info using node@v6.6.0
4 verbose run-script [ 'prebuild:prod', 'build:prod', 'postbuild:prod' ]
5 info lifecycle aspnetnetcore@0.0.0~prebuild:prod: aspnetnetcore@0.0.0
6 silly lifecycle aspnetnetcore@0.0.0~prebuild:prod: no script for prebuild:prod, continuing
7 info lifecycle aspnetnetcore@0.0.0~build:prod: aspnetnetcore@0.0.0
8 verbose lifecycle aspnetnetcore@0.0.0~build:prod: unsafe-perm in lifecycle true
9 verbose lifecycle aspnetnetcore@0.0.0~build:prod: PATH: C:\Users\Azayzel\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;c:\NEW_StudentLock_Core\AspNetCoreSpa\node_modules\.bin;C:\Users\Azayzel\AppData\Roaming\npm;C:\Program Files (x86)\nodejs\;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Common Files\Lenovo;C:\ProgramData\Lenovo\ReadyApps;C:\Program Files (x86)\Common Files\lenovo\easyplussdk\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\nodejs\;C:\Go\bin;c:\Go;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft Emulator Manager\1.0\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Users\Azayzel\AppData\Local\Microsoft\WindowsApps;c:\python27\python.exe;C:\Users\Azayzel\AppData\Roaming\npm;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.1.1;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.1.1
10 verbose lifecycle aspnetnetcore@0.0.0~build:prod: CWD: c:\NEW_StudentLock_Core\AspNetCoreSpa
11 silly lifecycle aspnetnetcore@0.0.0~build:prod: Args: [ '/d /s /c',
11 silly lifecycle   'node node_modules/webpack/bin/webpack.js --config config/webpack.prod.js --env.prod' ]
12 silly lifecycle aspnetnetcore@0.0.0~build:prod: Returned: code: 2  signal: null
13 info lifecycle aspnetnetcore@0.0.0~build:prod: Failed to exec build:prod script
14 verbose stack Error: aspnetnetcore@0.0.0 build:prod: `node node_modules/webpack/bin/webpack.js --config config/webpack.prod.js --env.prod`
14 verbose stack Exit status 2
14 verbose stack     at EventEmitter.<anonymous> (C:\Users\Azayzel\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Users\Azayzel\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:877:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid aspnetnetcore@0.0.0
16 verbose cwd c:\<emitted>\AspNetCoreSpa
Azayzel commented 7 years ago

Ok, when adding -f to npm build in .csproj, it builds perfect.


 <ItemGroup>
    <Compile Remove="node_modules\**\*;Client\**\*" />
    <Content Remove="wwwroot\dist\**\*" />
  </ItemGroup>  

  <Target Name="RunWebpack" BeforeTargets="BeforePublish">
     <Exec Command="npm run clean:dist" />
    <Exec Command="npm run build:prod -f" /> 
    <ItemGroup>
      <DistFiles Include="wwwroot\dist\**\*" />
      <Content Include="@(DistFiles)" CopytoPublishDirectory="Always" />
      <Content Include="app.yaml" CopyToOutputDirectory="Always" />
      <ContentWithTargetPath Include="@(DistFiles)" TargetPath="%(Identity)" CopyToPublishDirectory="Always" />
    </ItemGroup>
  </Target>