Closed Azayzel closed 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 ]
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>
What version of node/npm/typescript is installed on your machine?
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.
Is anyone else able to publish via File Publish? I grabbed a fresh copy of the project and still was not able to.
I just tried the following:
All worked as expected!
maybe becuase my TS verison is ahead of the packages? Ill try to uninstall and re-install 2.2.2
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
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>
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