Synopsis
When I use npx create-next-app@latest
, I am prompted to install a newer package version. I cannot find a parameter on npx
to make the command silently work inside of a script.
For example, I would expect to find a parameter such as --silent
or --force
or --yes
, as is common convention with other package managers.
There has to be an easy answer to this, but I honestly can't find it.
FYI I am using PowerShell as my shell environment on Windows 10, although I would expect the npx
command to provide a parameter, instead of having to use shell features (piping) to accomplish this.
PS C:\git\myapp> npx create-next-app@latest
Need to install the following packages:
create-next-app@latest
Ok to proceed? (y)
The npx --help
command doesn't produce any guidance.
PS > npx --help
npm exec
Run a command from a local or remote npm package
Usage:
npm exec -- <pkg>[@<version>] [args...]
npm exec --package=<pkg>[@<version>] -- <cmd> [args...]
npm exec -c '<cmd> [args...]'
npm exec --package=foo -c '<cmd> [args...]'
Options:
[--package <pkg>[@<version>] [--package <pkg>[@<version>] ...]]
[-c|--call <call>]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
[-ws|--workspaces]
alias: x
Run "npm help exec" for more info
Actual Result
npx pauses execution until user input is provided.
Expected Result
npx automatically installs the latest version of the package and executes it, without prompting the user.