question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Run Locally Error: ValueError: Path resolution for runtime: nodejs8.10 of binary: npm was not successful

See original GitHub issue

Describe the bug When clicking “Run Locally” for a NodeJS 8.10 function inside VS Code, I receive the following error: ValueError: Path resolution for runtime: nodejs8.10 of binary: npm was not successful

To Reproduce

  1. From terminal, sam init
  2. Within SAM project directory in VS Code, open hello-world/app.js
  3. Click the Run Locally button above exports.lambdaHandler

Expected behavior Expect function to run locally without error.

Screenshots Preparing to run app.lambdaHandler locally... Building SAM Application... Error: sam build encountered an error: 2019-04-23 18:01:20 Building resource 'awsToolkitSamLocalResource' ,Traceback (most recent call last): File "/usr/local/bin/sam", line 11, in <module> load_entry_point('aws-sam-cli==0.15.0', 'console_scripts', 'sam')() File "/usr/local/Cellar/aws-sam-cli/0.15.0/libexec/lib/python3.7/site-packages/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "/usr/local/Cellar/aws-sam-cli/0.15.0/libexec/lib/python3.7/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/usr/local/Cellar/aws-sam-cli/0.15.0/libexec/lib/python3.7/site-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/Cellar/aws-sam-cli/0.15.0/libexec/lib/python3.7/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/Cellar/aws-sam-cli/0.15.0/libexec/lib/python3.7/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/usr/local/Cellar/aws-sam-cli/0.15.0/libexec/lib/python3.7/site-packages/click/decorators.py", line 64, in new_func return ctx.invoke(f, obj, *args[1:], **kwargs) File "/usr/local/Cellar/aws-sam-cli/0.15.0/libexec/lib/python3.7/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/usr/local/Cellar/aws-sam-cli/0.15.0/libexec/lib/python3.7/site-packages/samcli/commands/build/command.py", line 100, in cli skip_pull_image, parameter_overrides, mode) # pragma: no cover File "/usr/local/Cellar/aws-sam-cli/0.15.0/libexec/lib/python3.7/site-packages/samcli/commands/build/command.py", line 141, in do_cli artifacts = builder.build() File "/usr/local/Cellar/aws-sam-cli/0.15.0/libexec/lib/python3.7/site-packages/samcli/lib/build/app_builder.py", line 108, in build lambda_function.runtime) File "/usr/local/Cellar/aws-sam-cli/0.15.0/libexec/lib/python3.7/site-packages/samcli/lib/build/app_builder.py", line 199, in _build_function runtime) File "/usr/local/Cellar/aws-sam-cli/0.15.0/libexec/lib/python3.7/site-packages/samcli/lib/build/app_builder.py", line 220, in _build_function_in_process mode=self._mode) File "/usr/local/Cellar/aws-sam-cli/0.15.0/libexec/lib/python3.7/site-packages/aws_lambda_builders/builder.py", line 115, in build return workflow.run() File "/usr/local/Cellar/aws-sam-cli/0.15.0/libexec/lib/python3.7/site-packages/aws_lambda_builders/workflow.py", line 48, in wrapper exec_paths = binary_path.resolver.exec_paths if not binary_path.path_provided else binary_path.binary_path File "/usr/local/Cellar/aws-sam-cli/0.15.0/libexec/lib/python3.7/site-packages/aws_lambda_builders/path_resolver.py", line 29, in exec_paths return self._which() File "/usr/local/Cellar/aws-sam-cli/0.15.0/libexec/lib/python3.7/site-packages/aws_lambda_builders/path_resolver.py", line 24, in _which "{} was not successful".format(self.runtime, self.binary)) ValueError: Path resolution for runtime: nodejs8.10 of binary: npm was not successful

Desktop: VS Code version 1.33.1 2. Node version 8.10.0 3. SAM CLI version 0.15.0 4. AWS Toolkit for VS Code v0.1.1 5. Mac Sierra 10.12.6

Additional context It’s worth noting that if I open a terminal, navigate to project directory, and run the command below, the local test works as expected: sam local invoke "HelloWorldFunction" -e event.json

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
awschristoucommented, Apr 26, 2019

Hi @matwerber1 , do you typically open VS Code from the Application Tray? If so, can you please try launching VS Code from the same terminal that you have success running sam local invoke from? I’d like to know if it that succeeds.

Would you also be able to provide:

  • the location of your npm executable (which npm)
  • your SHELL environment variable (echo $SHELL)
0reactions
justinmk3commented, Feb 1, 2021

If this is still an issue in the latest Toolkit please open a new issue. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

yarn --scripts-prepend-node-path
valueerror path resolution for runtime nodejs8 10 of binary npm was not successful. NODE_PATH was originally created to support loading modules from varying ......
Read more >
raise ValueError("Unsupported Lambda runtime {}".format ...
One of the reasons it is not working is you may be using lambda edge, which doesn't support runtime node 12.x yet.
Read more >
aws-sam-local - npm
Start using aws-sam-local in your project by running `npm i aws-sam-local`. ... AWS SAM CLI is not distributed via NPM anymore.
Read more >
Documentation - Ethers.js
The provider offers some basic operations to help resolve and work with ENS names. ... ignoring errors due to the target node not...
Read more >
A Comprehensive Guide to Fixing Node-Gyp Issues on Windows
Try running npm install –no-optional to install only the required dependencies. If you run this and still get the error, I have bad...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found