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

Arun07's avatar

npm run dev (or production) stops at setup with no errors

Hi

I have a laravel project and am using laravel mix for transpiling js and scss

Everything works fine on my local machine and on my colleagues machine, but on out testing server, when I try running npm run dev or npm run prod, nothing happens. It just stops without any success or error message

Here's an image showing the output

https://i.imgur.com/5I2zMHZ.png

[private@private privateFolder]$ npm run development


> development
> mix


● Mix █████████████████████████ setup (8%)
 compilation


[private@private privateFolder]$

As seen here, it just stops at 8% everytime, no js and css files are generated in the output path and no errors are thrown either, so I have no clue on what the issue is. And let me remind again that there's no issue when running it on local

Here's a verbose output

[private@private privateFolder]$ npm run development --verbose
npm verb cli [
npm verb cli   '/usr/local/bin/node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'run',
npm verb cli   'development',
npm verb cli   '--verbose'
npm verb cli ]
npm info using [email protected]
npm info using [email protected]
npm timing npm:load:whichnode Completed in 2ms
npm timing config:load:defaults Completed in 2ms
npm timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms
npm timing config:load:builtin Completed in 1ms
npm timing config:load:cli Completed in 4ms
npm timing config:load:env Completed in 0ms
npm timing config:load:file:/home/private/privateFolder/.npmrc Completed in 0ms
npm timing config:load:project Completed in 1ms
npm timing config:load:file:/home/private/.npmrc Completed in 0ms
npm timing config:load:user Completed in 0ms
npm timing config:load:file:/usr/local/etc/npmrc Completed in 1ms
npm timing config:load:global Completed in 1ms
npm timing config:load:validate Completed in 0ms
npm timing config:load:setEnvs Completed in 1ms
npm timing config:load Completed in 10ms
npm timing npm:load:configload Completed in 10ms
npm timing npm:load:setTitle Completed in 0ms
npm timing npm:load:setupLog Completed in 2ms
npm timing npm:load:cleanupLog Completed in 3ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load:projectScope Completed in 1ms
npm timing npm:load Completed in 23ms
npm timing config:load:flatten Completed in 3ms
[..................] | : timing config:load:flatten Completed in 3ms
> development
> mix

npm verb cli [.....] | : timing config:load:flatten Completed in 3ms
npm verb cli   '/usr/local/bin/node',
npm verb cli   '/usr/local/lib/node_modules/npm/bin/npm-cli.js',
npm verb cli   'exec',
npm verb cli   '--',
npm verb cli   'webpack',
npm verb cli   '--progress',
npm verb cli   '--config=node_modules/laravel-mix/setup/webpack.config.js'
npm verb cli ]
npm info using [email protected]
npm info using [email protected]
npm timing npm:load:whichnode Completed in 2ms
npm timing config:load:defaults Completed in 2ms
npm timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 0ms
npm timing config:load:builtin Completed in 1ms
npm timing config:load:cli Completed in 2ms
npm timing config:load:env Completed in 1ms
npm timing config:load:file:/home/private/privateFolder/.npmrc Completed in 0ms
npm timing config:load:project Completed in 2ms
npm timing config:load:file:/home/private/.npmrc Completed in 1ms
npm timing config:load:user Completed in 1ms
npm timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
npm timing config:load:global Completed in 0ms
npm timing config:load:validate Completed in 1ms
npm timing config:load:setEnvs Completed in 2ms
npm timing config:load Completed in 12ms
npm timing npm:load:configload Completed in 12ms
npm timing npm:load:setTitle Completed in 0ms
npm timing npm:load:setupLog Completed in 1ms
npm timing npm:load:cleanupLog Completed in 3ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load:projectScope Completed in 0ms
npm timing npm:load Completed in 23ms
npm timing config:load:flatten Completed in 3ms

● Mix █████████████████████████ setup (8%)
 compilation

npm timing command:run-script Completed in 4717ms
npm verb exit 1
npm timing npm Completed in 4940ms
npm verb code 1
[private@private privateFolder]$

Node Version: v15.14.0

Npm Version: 7.7.6

Laravel Mix version: 6.0.16

Server OS: CentOS Linux 7 (Core)

Anyone got any clue on how to fix this, or atleast where I should look to see what's wrong?

0 likes
11 replies
Arun07's avatar

@tomasosho Unfortunately no, running those gave no change

I deleted node_modules folder and tried again, but no change. Always stops at 8%.

tomasosho's avatar

In your root directory, find the file "package-lock.json" and delete it. Do the same with the folder called "node_modules". After that, do "npm install".

Hope it helps.

Arun07's avatar

@jlrdw I had already tried that before, but it was no use.

Also, in my case npm run dev is not stuck, it just stops immediately as it reaches 8%, there's no hanging or anything like that, I run npm run dev and in 2-3 seconds it just stops and exits immediately with no errors or any other output

jlrdw's avatar

Perhaps try removing one package at a time see if a particular package is causing a problem.

1 like
Arun07's avatar

Actually, I think this is an issue with npm itself, or how it has been configured on the server and not due to any package.

Because when I directly ran

node node_modules/laravel-mix/bin/cli.js

(this is the script that is called in the end by npm run dev), it succeeded without issues ( although very very slow ).

Also, just to be sure, I created another fresh project and npm run dev wasn't working there either, so I suspect npm is the culprit

I haven't found the actual issue or the cause yet, but will keep looking

Please or to participate in this conversation.