Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run Helloworld application locally for Node.js #743

Open
sahilkapoor89 opened this issue Aug 21, 2019 · 2 comments
Open

Cannot run Helloworld application locally for Node.js #743

sahilkapoor89 opened this issue Aug 21, 2019 · 2 comments

Comments

@sahilkapoor89
Copy link

Describe the bug
When ever I try to run the sample Hello world application for node.js I get an error saying SAM build command failed

This issue is related to aws/aws-toolkit-jetbrains#950

To Reproduce
OS: Windows
Steps to reproduce the behavior:

  1. Create new AWS SAM application
  2. Select nodejs 10.x
  3. Select a folder in D: drive
  4. enter application name
  5. go to app.js and select run locally

Expected behavior
Function to run locally

Logs:
Starting SAM Application deployment...
Building SAM Application...
Error with child process: 2019-08-21 16:05:22 Building resource 'HelloWorldFunction'
,2019-08-21 16:05:22 Running NodejsNpmBuilder:NpmPack
,2019-08-21 16:05:24 Running NodejsNpmBuilder:CopyNpmrc
,2019-08-21 16:05:24 Running NodejsNpmBuilder:CopySource
,2019-08-21 16:05:24 Running NodejsNpmBuilder:NpmInstall
,2019-08-21 16:05:28 Running NodejsNpmBuilder:CleanUpNpmrc
,Traceback (most recent call last):
File "runpy.py", line 193, in _run_module_as_main
File "runpy.py", line 85, in run_code
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli_main
.py", line 12, in
cli(prog_name="sam")
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 722, in call
return self.main(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\commands\build\command.py", line 103, in cli
skip_pull_image, parameter_overrides, mode) # pragma: no cover
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\commands\build\command.py", line 151, in do_cli
artifacts)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\build\app_builder.py", line 143, in update_template
artifact_relative_path = os.path.relpath(built_artifacts[logical_id], original_dir)
File "ntpath.py", line 584, in relpath
ValueError: path is on mount 'C:', start on mount 'd:'
An error occurred while deploying a SAM Application. Check the logs for more information by running the "View AWS Toolkit Logs" command from the Command Palette.

Desktop (please complete the following information):

  • OS: Windows
  • Visual Studio Code Version: 1.37.1
  • AWS Toolkit for Visual Studio Code Version: 1.0.0
@bryceitoc9
Copy link
Contributor

Hi @sahilkapoor89 , thanks for writing in.

Looks like this might be an issue with the SAM CLI; I'd recommend taking a look at the issue here: aws/aws-sam-cli#1336

In the meantime, can you try running your code out of the C:\ drive?

@sahilkapoor89
Copy link
Author

@bryceitoc9 As per your suggestion I moved my code to the C:\ drive but still the build was failing with the same error. Finally I figured out that my VSCode was installed on the D:\ drive and once I moved VSCode to C:\ drive everything started working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants