Suppress 'would you like to install any of the official modules' when using npx nuxi@latest init
I am attempting to create a Windows command file to be run unattended that creates a standard, empty Nuxt 3 project.
When I use this syntax I get the new feature that displays a list of official modules to select from:
npx nuxi@latest init acsw-mp-lite --packageManager npm --gitInit false
I don't want to see this list or pick from it because I install my modules separately, how can I suppress this option?
Failing a way to suppress this list, what command would I use to install a standard module such as eslint to avoid the problem?
For the latter so far I have tried these but neither works:
npx nuxi@latest init acsw-mp-lite --packageManager npm --gitInit false --modules 'eslint'
and
npx nuxi@latest init acsw-mp-lite --packageManager npm --gitInit false --modules '@nuxt/eslint'
Note: I can suppress the list by using '--preferOffline' but this is just a fudge
I have had a look at the official doco but can't seem to find an answer.
What are my options please?
2 Replies
Hi @Bob. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the available knowledge sources, there is no documented or supported way to suppress the "Would you like to install any of the official modules" prompt when running npx nuxi@latest init for unattended Nuxt 3 project creation. The documentation for nuxi init does not mention any flag or option to disable this prompt or to pre-select modules during initialization. The --modules option you tried is not documented as a valid option for nuxi init, so it will not have any effect Nuxt nuxi init docs.
As for installing a standard module like eslint after project creation, the recommended approach is to use the nuxi module add command. For example, to add the official ESLint module, you would run:
This command will install the @nuxt/eslint module, update your package.json, and configure your nuxt.config.ts accordingly Nuxt nuxi module docs ESLint module docs.
In summary:
- There is no official way to suppress the module selection prompt in nuxi init according to current documentation.
- The correct way to add modules like eslint is to use npx nuxi module add eslint after initializing your project.
If you need a fully unattended setup, you may need to script around the prompt (e.g., using expect or similar tools), but this is not covered in the official documentation.
If you have further requirements or if new options are introduced in future releases, please refer to the official Nuxt documentation for updates.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@1298911727185952809> Kapa.ai is still learning and improving, please let me know how I did by reacting below.