SAM CLI did not return expected data
Describe the bug
Hi,
I have installed aws toolkit on visual studio code and have this error message:
2019-10-08 16:26:22 [ERROR]: SyntaxError: Unexpected token I in JSON at position 0
at JSON.parse (
To Reproduce Steps to reproduce the behavior:
- Go to VisualStudio Code
- On the menu bar, choose View, Command Palette.
- Click on "AWS: Create new SAM Application"
- See error
Desktop (please complete the following information):
- OS: Windows 10 64 bit
- Visual Studio Code Version: 1.38.1
- AWS Toolkit for Visual Studio Code Version: 1.1.0
- SAM Cli version: 0.22
- Docker version: 19.03.2
Do you have any idea for this problem ?
Thank you, Davide
Hi @davidellolio I have a few things for you to try out:
Is there a chance you installed the SAM CLI while you had VS Code open? You may need to close and re-open VS Code before you are able to create a new SAM Application.
Otherwise, go into your VS Code Settings (Ctrl + ,) and navigate to Extensions -> AWS Configuration. Look for the Aws › Samcli: Location field, and see if this points to the location of your SAM CLI program. If it doesn't, you can either set that value, or you can access the Command Palette (F1) and run AWS: Detect SAM CLI to see if it will detect it.
If you're unable to create a SAM Application after that, if you can open a command prompt and run sam --info I'd be interested in seeing the output.
Hi Christou,
I have solved the problem.
The AWS Samcli was conflict with npm aws samcli. I have uninstalled with "npm uninstall -g aws-sam-local" command and now work.
Thank you so much.
Thank you for the follow up!
@awschristou your configuration suggestion worked for me.
Cool :-)