Skip to content

Windows: Unable to build SAM TypeScript project on D: drive #2547

Open

Description

@YoshiWalsh

If I use a non-TypeScript template, AWS Toolkit is able to build and run my app. If I use a TypeScript template, I can build it successfully using sam build in PowerShell. But attempting to build a TypeScript template with AWS Toolkit gives the following error:

2022-03-29 08:33:03 [INFO]: 
Build Failed

2022-03-29 08:33:04 [INFO]: Error: NodejsNpmEsbuildBuilder:CopyDependencies - [WinError 5] Access is denied: '.aws-sam'

2022-03-29 08:33:04 [WARN]: "sam build" failed: D:/git/myproject/template.yaml

To Reproduce

  1. Run sam init
  2. Select 1 (AWS Quick Start Templates)
  3. Select 1 (Hello World Example)
  4. Select N (don't use most popular runtime and package type)
  5. Select nodejs14.x (currently option 8)
  6. Select 1 (zip)
  7. Select 2 (Hello World Example TypeScript)
  8. Put in any project name.
  9. Once SAM has created the project, open it in VSCode.
  10. Go to the "Run and Debug" tab and open the launch configuration dropdown.
  11. Select "Add configuration"
  12. Choose "AWS SAM: Template-based Lambda invoke"
  13. Attempt to launch the project

Expected behavior

The project should successfully build and launch.

Desktop (please complete the following information):

  • OS: Windows_NT x64 10.0.19043
  • Visual Studio Code Version: 1.58.1
  • AWS Toolkit Version: 1.37.0

Additional context

Possibly related to #2511

Activity

  1. added
    bugWe can reproduce the issue and confirmed it is a bug.
    on Mar 28, 2022
  2. JadenSimon commented on Mar 29, 2022

    @JadenSimon
    Contributor

    Thanks for the report!

    Is VS Code installed on a different drive? That could potentially be a source of problems, though the error makes it seem more like a permissions issue.

  3. YoshiWalsh commented on Mar 29, 2022

    @YoshiWalsh
    Author

    Yes, VSCode is on C and my projects are on D.

    I've switched to using a preLaunchTask to transpile the TypeScript code and it seems to work well now.

  4. changed the title [-]Unable to build SAM project with TypeScript[/-] [+]Windows: Unable to build SAM TypeScript project on D: drive[/+] on Mar 30, 2022
  5. justinmk3 commented on Mar 30, 2022

    @justinmk3
    Contributor

    related: #2296

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugWe can reproduce the issue and confirmed it is a bug.platform:windowssam

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions