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

Unknown output type: JSON #13

Closed
gilesbutler opened this issue Oct 26, 2016 · 8 comments
Closed

Unknown output type: JSON #13

gilesbutler opened this issue Oct 26, 2016 · 8 comments

Comments

@gilesbutler
Copy link

Hey Guys,

I'm getting this error when I run npm run setup - the stack gets created but any subsequent updates won't deploy.

> aws cloudformation create-stack --stack-name $npm_package_config_cloudFormationStackName --template-body file://./cloudformation.json --capabilities CAPABILITY_IAM --parameters ParameterKey=AwsServerlessExpressS3Bucket,ParameterValue=$npm_package_config_s3BucketName --region $npm_package_config_region


Unknown output type: JSON

npm ERR! Darwin 16.0.0
npm ERR! argv "/Users/gb/.nvm/versions/node/v4.3.2/bin/node" "/Users/gb/.nvm/versions/node/v4.3.2/bin/npm" "run" "create-stack"
npm ERR! node v4.3.2
npm ERR! npm  v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! aws-serverless-express-example@1.1.0 create-stack: `aws cloudformation create-stack --stack-name $npm_package_config_cloudFormationStackName --template-body file://./cloudformation.json --capabilities CAPABILITY_IAM --parameters ParameterKey=AwsServerlessExpressS3Bucket,ParameterValue=$npm_package_config_s3BucketName --region $npm_package_config_region`
npm ERR! Exit status 255
@brettstack
Copy link
Collaborator

Hi @gilesbutler, what's your aws cli config look like?

What happens if you add --output json to the end of the command in package.json?

@gilesbutler
Copy link
Author

Hey @brettstack

I'm testing it with updating new functions so I had to add it to the end of update-function command. That fixed the problem though and now outputs JSON with no errors thanks.

Should that be added to every aws call then?

@brettstack
Copy link
Collaborator

It would be better to find the root cause of the problem, likely in your aws cli config

@gilesbutler
Copy link
Author

Spot on! Thanks @brettstack - I ran aws configure and changed Default output format: JSON to text and now it's working perfectly!

Thanks for your help 👍

@optimus-kart
Copy link

@gilesbutler I had faced a similar issue changing "JSON" to "json" (lower case) after running aws configure solved the problem

@gilesbutler
Copy link
Author

Awesome thanks @optimus-kart! Great spot 👍

@BOLT2612
Copy link

@optimus-kart your answer works better for me. Both "text" and "json" solve the problem, but "json" gives nicely formatted, easily readable output.

@mohammed1982-erbil
Copy link

@optimus-kart , it work, with me, perfect

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

5 participants