Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

StandardNpmSynthOptions doesn't contain InstallCommands #175

Closed
OksanaH opened this issue Oct 31, 2020 · 7 comments · Fixed by #268
Closed

StandardNpmSynthOptions doesn't contain InstallCommands #175

OksanaH opened this issue Oct 31, 2020 · 7 comments · Fixed by #268
Labels
bug This issue is a bug. effort/medium Medium work item – a couple days of effort language/dotnet Related to the .NET workshop p1

Comments

@OksanaH
Copy link

OksanaH commented Oct 31, 2020

Hello I've pulled the repo, and am getting the error "StandardNpmSynthOptions doesn't contain InstallCommands/BuildCommands" in PipelineStack.cs

Bug

@OksanaH OksanaH added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 31, 2020
@SomayaB SomayaB added the language/dotnet Related to the .NET workshop label Nov 2, 2020
@NGL321 NGL321 added effort/medium Medium work item – a couple days of effort p1 and removed needs-triage This issue or PR still needs to be triaged. labels Jan 4, 2021
@NGL321
Copy link
Contributor

NGL321 commented Jan 4, 2021

Hey @OksanaH,

I can confirm this, I will look into a patch ASAP.

😸 😷

@olivboom
Copy link

olivboom commented Jan 25, 2021

@NGL321 It looks to me like the BuildCommands and InstallCommands should be BuildCommand and InstallCommand. The extra "s" isn't required as shown here:
https://docs.aws.amazon.com/cdk/api/latest/dotnet/api/Amazon.CDK.Pipelines.SimpleSynthAction.html#Amazon_CDK_Pipelines_SimpleSynthAction_StandardNpmSynth_Amazon_CDK_Pipelines_IStandardNpmSynthOptions_.

These commands should be singular strings instead of arrays of commands. You can workaround this with the following which fixes the issue:

                    InstallCommand = "npm install -g aws-cdk && sudo apt-get install -y dotnet-sdk-3.1",
                    
                    BuildCommand = "dotnet build" // Language-specific build cmd

This also ties into the following ticket about passing multiple synth commands instread of the awkward && way of chaining commands. aws/aws-cdk#9357

@olivboom
Copy link

However this does leads to other issues down the line of not being able to install dotnet-sdk-3.1 on Code Build which i think is related to this thread - dotnet/core#4360

@OksanaH
Copy link
Author

OksanaH commented Mar 10, 2021

I think this command will do the .NET Core installation: "npm install -g aws-cdk && wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && dpkg -i packages-microsoft-prod.deb && apt-get update && apt-get install -y apt-transport-https && apt-get update && apt-get install -y dotnet-sdk-3.1"

@TimTraylor
Copy link

@OksanaH Thank you! That got me over one hurdle.

@hakanson
Copy link
Contributor

Running this just 2 weeks ago, I used these lines of code. No need to install dotnet-sdk-3.1 on CodeBuild and I targeted the src directory with my dotnet build command.

InstallCommand = "npm install -g aws-cdk", 
BuildCommand = "dotnet build src", // Language-specific build cmd

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. effort/medium Medium work item – a couple days of effort language/dotnet Related to the .NET workshop p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants