Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

node.js

npx

expo

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 command:

npx create-expo-app my-app --template

I choose the blank Typescript template. It generated an app and then I cd into the app directory. When I run npx run web, first it asks for me to install some dependencies, so then I do:

npx expo install react-native-web@~0.18.10 [email protected] @expo/webpack-config@^18.0.1

Now when I try to run npx run web, I get the following error:

/Users/paul/.npm/_npx/755986f37193a6d8/node_modules/run/run.js:127
    if (minimatch(file, pattern)) {
        ^

TypeError: minimatch is not a function

How get I fix this error and get the expo server to start?

like image 684
pjb3 Avatar asked Sep 13 '25 05:09

pjb3


2 Answers

I was getting this when trying to run an Astro project:

npx run dev

The problem was that I was actually supposed to be running npm run:

npm run dev
like image 127
Kayce Basques Avatar answered Sep 14 '25 19:09

Kayce Basques


After upgrading to minimatch v9, in order to fix this just change

minimatch()

to

minimatch.minimatch()
like image 43
GodDmitrii Avatar answered Sep 14 '25 19:09

GodDmitrii