How to automate answers to the new create-next-app? - next.js

The next npx create-next-app#latest asks a bunch of questions. They break our automatic docker pipeline.
How can we automate them?
Right now, we use this command in our Dockerfile:
RUN npx --yes create-next-app site --use-npm
However, it asks two questions:
Would you like to use TypeScript with this project? … No / Yes
Would you like to use ESLint with this project? › No / Yes
How can we provide answer to these questions alonside the npx command?

Taking a look at the source code, if you specify either --js or --ts, you won't be prompted. Similarly, you can specify --eslint or --no-eslint.

Related

What is CLI equivalent for "Would you like to use `src/` directory with this project" in Next.js 13.1.2

We have an automated image creation pipeline that uses CLI to create a default Next.js app and install dependencies, etc.
This is our code:
WORKDIR /
RUN npx --yes create-next-app next --use-npm --js --eslint
WORKDIR /next
Yesterday Next.js team released their 13.1.2 version, which broke this line.
They have added a new CLI option that asks:
? Would you like to use src/ directory with this project? › No / Yes
What is the option to automate the answer for this option?
The option you are looking for is --src-dir. So to automate the initialization using src directory you should run:
npx create-next-app --src-dir
Check documentation here

Object.fromEntries is not a function

I've been following Tailwind's tutorials and when. I get to the part of the tutorial where they ask me to run
-npx tailwindcss init,
-Object.fromEntries is not a function
I get the following error. How do I solve this?
I'm trying to learn tailwind css and I got a problem that I don't understand, please help me guys
first run node -v in your terminal to check you have nodejs or not
then run npm init -y to install dependencies'
then run npm install -D tailwindcss
after that run npx tailwindcss init
hopefully after doing this you will be able to process further into your project

how to make a custom build for tom-select.js?

I can't figure out how to make a custom build for tom-select.js. In the gruntfile.js I see this:
// build tom-select.custom.js
/* this file is generated by grunt when calling `npm run build -- --plugins=<plugins> */
so should I just list the plugins in the command line after npm run build command with --plugins flag? What is the syntax for this? Thanks!
I just found the answer:
create /build/js/tom-select.custom.js
npm run build -- --plugins=remove_button,restore_on_backspace

No valid exports main found on npm (tailwind css)

i am learning tailwind css and in tutorial they write a command like this npx tailwindcss-cli build css/tailwind.css -o build/tailwind.css
and it build a different folder name "tailwind.css" in same directory
but in my case it gives a error
No valid exports main found for 'C:\Users\HHH\AppData\Roaming\npm-cache\_npx\4952\node_modules\tailwindcss-cli\node_modules\postcss'
I don't have any idea what it means and whats wrong with the setup.
please help.
I find the solution.
Just install the current node.js and reinstall the specific version.
download here
After that install it and everything works fine.
Note: It works in when you follow the tailwindcss cli method.
follow first part of video

Running RVM Passenger install afk

Currently, when I rebuild Phusion Passenger with Nginx, I am running the command
rvmsudo passenger-install-nginx-module
However, I am now converting the upgrade process into an Ansible playbook. I'm wonering if it's possible to run the above command with default options so that the install completes itself without requiring me to input the usual options (Nginx + install path). I haven't found any docs explaining if this is possible or not.
Thanks
Yes it is possible. Use the --auto and the --auto-download flags. Make sure to resolve and download all dependencies with apt-get.
The complete command should look something like this:
passenger-install-nginx-module --auto --auto-download
Yes it is possible. There is official documentation here on the subject: https://www.phusionpassenger.com/library/install/nginx/noninteractive_install.html

Resources