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.

[Feature Request] Example json using cli option --answers

See original GitHub issue

I have tried to figure out the structure of the json used with npx create-nuxt-app --answers <json>

The cli documentation does not show the --answers flag as an option.

but when I run create-nuxt-app --help I get

“–answers <json> Skip all the prompts and use the provided answers”

Would someone please show a working example usage please? I have gotten this far…

npx create-nuxt-app --answers {"name":"new proj yo","description":"sweet-new-proj","author":"jasenmichael","pm":"npm","ui":"none","server":"none","features":{"axios","pwa","dotenv"},"linter":{},"test":"jest","mode":"spa","devTools":{"jsconfig.json"}}

I get an error

create-nuxt-app v2.14.0
✨  Generating Nuxt.js project in description:sweet-new-proj
Trace: Error: Answers JSON could not be parsed (Unexpected token a in JSON at position 1)

cheers

Nuxt changed my life…

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
jasenmichaelcommented, May 17, 2021

@AllanOricil take a look round in the create-nuxt-app src code https://github.com/nuxt/create-nuxt-app/tree/master/packages/create-nuxt-app

each option is a string or array of strings

name: 'my-nuxt-project', //defaults to out folder
description: ''site description...,
language:  'ts' || 'js', //only needed if using ts
features: [
  pwa,
  axios,
  content,
],
linter: [
  'eslint',
  'prettier',
  'lintStaged',
  'stylelint',
  'commitlint'
],
test: [
  'none',
  'jest',
  'ava',
  'webdriverio',
  'nightwatch'
], //defaults to none
mode: 'universal' || 'spa', //defaults to universal
target: 'server' || 'static', //defaults to server
devTools: [
  'jsconfig.json',
  'semantic-pull-requests',
  'dependabot'
], // defaults to []
ci: 'none' || 'github-actions' || 'travis-ci' || 'circleci',  // defaults to none

pm: 'yarn' || 'npm', //defaults to yarn

all that was found in these 2 files https://github.com/nuxt/create-nuxt-app/blob/master/packages/create-nuxt-app/lib/prompts.js https://github.com/nuxt/create-nuxt-app/blob/master/packages/create-nuxt-app/lib/saofile.js

0reactions
Shywimcommented, Nov 25, 2021

Got the same error using yarn create too, npx is working fine though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting the AWS CLI output format - AWS Documentation
Using the --output option on the command line – The following example sets the output of only this one ... JSON is the...
Read more >
JSON - HTTPie 3.2.1 (latest) docs
To see all the HTTP communication, i.e. the final request/response as well as any possible intermediary requests/responses, use the --all option. The ...
Read more >
How do I POST JSON data with cURL? - Stack Overflow
It's a wrapper round CURL which simplifies command line REST requests. You point it to your API endpoint, and it gives you PUT...
Read more >
Using the CLI - Oracle Help Center
Format Output as a Table ... By default, all responses to a command are returned in JSON format. For example, a response like...
Read more >
JSON plugin for Grafana
The JSON Datasource executes requests against arbitrary backends and parses JSON ... To install this plugin using the grafana-cli tool: ... Example request:....
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