Skip to main content

Questions tagged [npx]

npx is a npm package runner that executes a <command> (e.g. npm package binaries) either from a local `node_modules/.bin`, or from a central cache, installing any packages needed to run the <command>.

Filter by
Sorted by
Tagged with
1042 votes
16 answers
396k views

Difference between npx and npm?

I have just started learning React, and Facebook helps in simplifying the initial setup by providing the following ready-made project. If I have to install the skeleton project I have to type npx ...
Paresh Maniyar's user avatar
250 votes
6 answers
117k views

"You are running create-react-app 4.0.3 which is behind the latest release (5.0.0)" [duplicate]

I got an error while creating a React application. How do I fix it?
Athif Saheer's user avatar
  • 4,607
166 votes
15 answers
420k views

npx command not found

I am working with webpack and I need to execute ./node_modules/webpack/bin/webpack.js using npx. npx webpack would run the webpack binary (./node_modules/webpack/bin/webpack), but each time I execute ...
wokoro douye samuel's user avatar
140 votes
42 answers
111k views

create-react-app is not working since version 4.0.1

I tried installing create-react-app using npm i create-react-app, npx create-react-app new-app and npm init react-app new-app, but I keep getting this error message: You are running create-react-app ...
Sumanth Hegde's user avatar
74 votes
4 answers
52k views

Can I use npx with pnpm?

Can I use npx together with a pnpm install? It doesn't seem to work and pnpx fetches remote dependencies, it seems more like npm create. Is there a way to use npx with pnpm to execute local binaries ...
Matt Sanders's user avatar
  • 9,793
70 votes
22 answers
37k views

Error while creating new React app ("You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0)")

I am getting this create React app error again and again even after doing the uninstall part. npm uninstall -g create-react-app up to date, audited 1 package in 570ms found 0 vulnerabilities npx ...
Newbie learner's user avatar
70 votes
1 answer
18k views

Automatically accept installing NPX package [duplicate]

When running an NPM package with npx for the first time, it will display a prompt asking if you want to download the package. For example, if you ran the command npx some-npm-package, you would ...
twiz's user avatar
  • 10.1k
55 votes
3 answers
41k views

How can I clear the central cache for `npx`?

Let's say you're running this command: npx gulp npx will search for gulp within node_modules/.bin, and if it doesn't find it there, it will use a central cache. If it is missing, npx will install it. ...
Flimm's user avatar
  • 145k
54 votes
29 answers
259k views

I can't install React using 'npx create-react-app'

I am trying to use the npx create-react app, but I have errors that are shown below: npm ERR! Unexpected end of Json input while parsing near '...eact-app/-/create-rea' npm ERR! A complete log of ...
zanjan_citizen's user avatar
51 votes
13 answers
15k views

npx create-react-app prompting to globally uninstall non-existent create-react-app package?

I am having problems with npx create-react-app involving global installs. My confusion arises because as far as I'm aware the create-react-app package is not installed on my machine. Some Details: I ...
Forrest Naylor's user avatar
41 votes
3 answers
21k views

What is difference between pnpm create, pnpx, dlx?

The pnpm package manager offers three commands that are alternatives for npm's npx command. These are pnpm create, pnpx and pnpm dlx. All three seem to do the same thing. But what are the differences ...
Arctomachine's user avatar
38 votes
4 answers
21k views

Cannot find module 'caniuse-lite/dist/unpacker/agents' when running create react app

I am trying to create a new react application. I have node version 14.15.3 and npm version 6.14 Error: Cannot find module 'caniuse-lite/dist/unpacker/agents' when running npx create-react-app issue ...
Charan Brijesh's user avatar
35 votes
2 answers
12k views

Does npx no longer do install-less run?

From the nodejs.dev site: npx allows you to run that npm command without installing it first. If the command isn't found, npx will install it into a central cache: They use this as an example: npx ...
jcollum's user avatar
  • 45.7k
33 votes
2 answers
17k views

Where does NPX store binaries after installation?

If I'm using npx to run a binary as a one-off, it'll output the following: npx my-module /// npx: installed 1 in 1.34s /// Hello, from my module! Where are these binaries stored by default? Does ...
Harrison Cramer's user avatar
33 votes
2 answers
21k views

Does npx use yarn?

Today I created a reactjs starting template with CRA using: npx create-react-app my-app --template redux This created two files in my project: package.json and yarn.lock. I am confused about why it ...
Vikram Ray's user avatar
  • 1,166
32 votes
5 answers
48k views

Npx with angular cli, how to install @angular/cli and use it afterwards

I just found NPX, this tool lets you install global packages without sudo rights. I want to use it with my angular projects. I run dev@b7ee560044f1:~/project$ npx -p @angular/cli ng version npx: ...
Alexander Kondaurov's user avatar
31 votes
2 answers
9k views

How to specify path(like npm --prefix) in npx?

This is my folder structure: project/ └── test_cases └── package.json The working dir is project/. I want to run eslint (an npm package) from working dir. I dont wish to cd into test_case. I ...
Adil Saju's user avatar
  • 1,169
24 votes
2 answers
7k views

Why does npx install webpack every time?

I have a JavaScript app I'm bundling with webpack. Per the docs, I'm using this command to start bundling: npx webpack Each time I get this output: npx: installed 1 in 2.775s I've verified that ...
bertday's user avatar
  • 10.9k
23 votes
9 answers
39k views

Tailwind in React project - getting "Cannot find module 'autoprefixer'" error during setup

I'm following the documentation for setting up Tailwind in a React project over on https://tailwindcss.com/docs/guides/create-react-app. I've been following the steps, but when I get to the part where ...
LiteralMetaphore's user avatar
23 votes
1 answer
16k views

Is there any npx create react app equivalent for vue cli?

I want to install vue for my project through npx, not globally and to be sure that I have the latest version of vue.js, just like is done in react. What is the command in the terminal to achieve that?
user29249's user avatar
  • 333
23 votes
4 answers
23k views

"TypeError: minimatch is not a function" error when running new expo project

I have the following libraries installed on my M1 Macbook running Ventura 13.3.1: $ nvm -v 0.39.3 $ node -v v18.16.0 $ npm -v 9.6.4 $ npx expo -v 0.7.0 I generated a new expo project using the ...
pjb3's user avatar
  • 5,273
22 votes
1 answer
5k views

Is it possible to run multiple binaries from a single module via npx?

(Note: I'm using the cowsay module here to illustrate my point) Without installing a module on my computer I can run it directly via npx with: npx cowsay Hello! If I have multiple binaries ...
dgwyer's user avatar
  • 799
21 votes
3 answers
24k views

Creating a Next.js app in VS Code does not have 'Pages' or 'Styles' folder

When creating a Next.js app in VS Code, I run the following command: 'npx create-next-app@latest' and go through the process of creating the app. However, Next.js's website shows that I should have a '...
zachrm25's user avatar
  • 213
20 votes
6 answers
12k views

Windows 10 -> 'npx create-react-app myapp' command does not work because of whitespace username in file path

I ran into some issues when trying to install a react app on my Windows 10 via npx create-react-app appname, receiving the following error message: Error: EPERM: operation not permitted, mkdir 'C:\...
Daniel's user avatar
  • 1,031
19 votes
1 answer
6k views

Error: Illegal characters in path in npm rimraf

I am getting an error while I tried to delete multiple directories using npm rimraf. Error: Illegal characters in path Command I run is rimraf **/lib/** > [email protected] clean-libs > ...
Sanke's user avatar
  • 736
19 votes
2 answers
15k views

Run NPX commands in debug mode

I got some npx create-react-app command stuck without showing any error on the terminal. So, I require to run npx in debug mode. Is there a way to get a debug log for npx commands to identify the ...
Nilanka Manoj's user avatar
17 votes
1 answer
15k views

Can I use NPX with yarn?

I have a project that I am using yarn for. I've installed all my packages using yarn, I run yarn dev and so on. Now I'm following a tutorial that requires me to use npx to set up a package. - I'm ...
antonwilhelm's user avatar
  • 7,028
16 votes
2 answers
11k views

IOS: Invalid `Podfile` file: no implicit conversion of nil into String

I just started learning react-native. While trying to run npx pod-install I get: Scanning for pods... 1.11.3 > pod install Auto-linking React Native modules for target `AudioOnlyRN`: ...
Don Code's user avatar
  • 868
16 votes
2 answers
4k views

npx: the shell-auto-fallback argument has been removed

I honestly don't remember what I last installed on my machine, I believe it was brewing gatsby-cli. Anyway, since yesterday morning my terminal has been giving me the following error when I open a new ...
Mike Earley's user avatar
  • 1,283
16 votes
1 answer
10k views

How to run npx with something similar to `--registry https://registry.npmjs.org` when running npm install to get around artifactory?

--registry https://registry.npmjs.org is been used to get around artifactory alike proxy when install with npm install But I want to do similiar thing with npm xxx because I encounter npm ERR! code ...
ey dee ey em's user avatar
  • 8,322
15 votes
1 answer
11k views

npm ERR! could not determine executable to run when running npx cap sync

When I run npx cap sync, I get: npm ERR! could not determine executable to run Several questions have been asked about this error, but none is related to capacitor. I started getting the error today ...
Cedric Ipkiss's user avatar
13 votes
7 answers
46k views

How do you fix npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead

How do you fix this problem? Nodejs npm and npx problem When i trying to install or check anything on command prompt. Node js through npm WARN config global --global, --local are deprecated. Use --...
Backend Rule's user avatar
13 votes
2 answers
8k views

npx does not look for latest version of package

I was making a simple npm package, I deleted the first version i.e, v0.1.0. So there is no v0.1.0 for my package. But I published later versions, with latest being v0.3.0. But when I execute npx <...
Nikhil's user avatar
  • 141
13 votes
2 answers
20k views

Cannot find module 'tsconfig-paths/register'

I'm trying to run a typescript script with ts-node in CLI, which means I don't have a package.json. Here's the command I'm trying to run: npx -p typescript@latest -p ts-node@latest -p @types/node@...
Michael Khaliavski's user avatar
13 votes
1 answer
4k views

How do I use --node-arg in npx / npm version 7?

npx used to have a --node-arg option to specify options for node. In npm v7, this results in: npx: the --n argument has been removed. See `npm help exec` for more information Which states: The --node-...
mikemaccana's user avatar
13 votes
2 answers
16k views

Does npx look for globally installed packages?

I am using Node.js 10.1.0 and npm 6.0.0. I have installed a package with npm install -g example-package, Will npx look for it? What about npx -p example-package, does it only look on npm registry?
Dimitri Kopriwa's user avatar
13 votes
1 answer
2k views

How to find out which file NPX runs?

When you run, say, npx webpack in a terminal, NPX finds a webpack package somewhere and runs it. How to identify the exact location of the binary that NXP runs? I'm looking for a tool like which in ...
Finesse's user avatar
  • 10.5k
12 votes
6 answers
17k views

Why am I getting errors with npx?

everytime when I run any npx command it gives me the same error. Except when I run: npx -v then it gives me the version: 9.2.0 here is the error: npm ERR! code ENOENT npm ERR! syscall lstat npm ERR! ...
Tim0123's user avatar
  • 135
12 votes
1 answer
6k views

Difference between npx create-react-app and create-react-app

What is the difference between npx create-react-app and create-react-app? React document says do npx creat-react-app but i see a tutorial in youtube and he say do create-react-app I tried both of them ...
user avatar
12 votes
3 answers
8k views

MaxListenersExceededWarning when installing or creating Node.js projects on macOS

I am getting the following warning message when I try to install or create Node.js projects on macOS (darwin): (node:80101) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ...
Parsa Sabet's user avatar
11 votes
7 answers
62k views

Angular update from 8 to 13 peer dependency problem

I'm updating my angular app by following the angular update guide and I'm stuck with an error of peer dependencies. First I update from angular 8 to 9 but there was still a peer dependency error. So I ...
Leinox's user avatar
  • 329
11 votes
1 answer
22k views

How to delete the localy installed version of npx command?

When I execute a command with npx, npx propose me to install a version locally. Example npx matcha-stock -s=MSFT If the version is updated on npm.org, npx gives me only the version installed locally ...
Raphael Mansuy's user avatar
11 votes
1 answer
2k views

running npx with scoped packages

I'm trying to execute a scoped package using npx. It seems like the only way to do it is specify the package directly, e.g.: npx -p @foo/bar bar Which will correctly download @foo/bar and run the ...
Elliot Nelson's user avatar
11 votes
5 answers
35k views

An unexpected error occurred: "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz: Request failed \"404 Not Found\"

When I try to create a new react app with create-react-app, I got the following: » npx create-react-app my-order Creating a new React app in /Users/ian/myproject/my-order. Installing packages. This ...
ian's user avatar
  • 111
11 votes
0 answers
1k views

How to make a private npm repo executable with npx?

I'm working on a command-line library, @namespace/cli. When I'm in my local project directory, I can run npx . and the cli starts as expected. However, after I npm publish and then run npx @...
marclar's user avatar
  • 3,036
10 votes
3 answers
14k views

npx create-react-app myapp error "\AppData\Roaming\npm-cache\_npx\19748" does not contain a package.json file in appdata folder

OS: Windows for creating react app using npx i've write the following command: npx create-react-app myapp it shows this error: npm ERR! Could not install from "myusername\AppData\Roaming\npm-...
Sarthak Bhagwat's user avatar
10 votes
1 answer
4k views

How to create your own npm starter-kit?

Starte of the art: Popular node.js frameworks come with their own starter-kits that act as project templates, such as React comes with the starter-kit . When user want to create a new react ...
dinkelaker's user avatar
9 votes
1 answer
3k views

npx mrm lint-staged erroring out with 'Preset "default" not found."

Example of the issue: ❯ npx mrm lint-staged npx: installed 298 in 9.141s Preset “default” not found. We’ve tried to load “mrm-preset-default” and “default” npm packages. Can't run this command and ...
mishchief's user avatar
  • 431
9 votes
1 answer
7k views

react-native run-android plugin not found and compile sdk is not specified

When running command npx react-native run-android --port=80 --verbose I get error: error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative....
Sparkeroo's user avatar
  • 143
8 votes
1 answer
30k views

How do I update path npx version?

When I run npx --version, it returns me v6.x.x But after I do npm install -g npx, yarn global add npx, and it shows successful download of npx v10, running npx --version still returns me v6.x.x ...
Samson's user avatar
  • 1,708

1
2 3 4 5
18