Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mustafaxpp's avatar

can't run npm run dev

I have a problem with npm run dev and I want someone to help me to solve it the code error is :

21 error code ELIFECYCLE 22 error syscall spawn bash 23 error file bash 24 error path bash 25 error errno -4058 26 error @ dev: npm run development 26 error spawn bash ENOENT 27 error Failed at the @ dev script. 27 error This is probably not a problem with npm. There is likely additional logging output above

0 likes
11 replies
sr57's avatar

First check your version, mines are

node --version; npm --version
v14.15.4
6.14.10

If you have an old version, begin by installing the last one

https://phoenixnap.com/kb/update-node-js-version

Then it complains for bash, check your path.

And last, erase and recreate your environment

    npm cache clean --force
    delete node_modules directory
    delete package-lock.json file
    npm install
mustafaxpp's avatar

I have the same version and I do all these steps and same problem

npm ERR! code ELIFECYCLE npm ERR! syscall spawn bash npm ERR! file bash npm ERR! path bash npm ERR! errno -4058 npm ERR! @ dev: npm run development npm ERR! spawn bash ENOENT npm ERR! npm ERR! Failed at the @ dev script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

warpig's avatar

Are you using it to load something like PostCSS, Tailwind? Is it something regarding Laravel Mix? So depending if this is the case, try uploading those libraries, an example of updating Sass:

npm i --save-dev sass-loader@latest

But I don't know what you are trying to do so.

mustafaxpp's avatar

I'm using jetstream so CSS file of UI of jetstream not working and need CSS and to read this ccc must mix it with npm run div to put this javascript file in public folder

warpig's avatar

Let us see your webpack.mix.js file, if I understood, you installed Jetstream and your CSS is not working. By default and from the docs, it says Jetstream comes with Tailwind, (I don't know if choosing between Intertia or Livewire makes a difference), however it says here that if you wanted to compile your CSS you should run npm run dev, so by checking your webpack that would suggest if Tailwind was initialized or not, because it doesn't come as a default and I don't know if by installing Jetstream it automatically changes your webpack.

Given the little information available posted in this question, my best solution for it would be to check if Tailwind is working because it may be that you can't compile your CSS because Tailwind is not initialized or something, who knows....

Add this into your webpack: require("tailwindcss"), Like in this example: https://tailwindcss.com/docs/guides/laravel#configure-tailwind-with-laravel-mix

mustafaxpp's avatar

Yes You are right that's what I mean but I see what you say and the link you send, Everything they told me it's in my files, and IDK why not working I'm so sad I can't send a photo here to see my error but I have everything right with Tailwind. I will tell you what I did from scratch ; I have laravel in my project and I open git bush and I run : 1- laravel new ProjectName --jet; (that makes my project with jetstream ; 2- I told the command line I want [0] that's mean liveware ; 3- I told the command line I will work with the team Yes

mustafaxpp's avatar

aha, okay thank you for trying to help me that's so much for me good luck pro

lemmon's avatar

@mustafaxpp Post the whole error and your webpack.mix.js file

What starter package are you using?

mustafaxpp's avatar

I don't know how it works on this site because they do not allow for me to upload the script because they say - > You may not include links the first day you sign up. and i just send code nothing more

mustafaxpp's avatar
mustafaxpp
OP
Best Answer
Level 1

I want to thank everyone who tried to help me the problem solved

I get the project from git bush then I make npm install in the git bush command line then npm run dev and it's work there

thank you everyone

1 like

Please or to participate in this conversation.