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

morhsn's avatar

Laravel Mix: npm run dev stuck with no errors or output

Hey everyone,

This is our first time using Laravel Mix and Webpack.

We're creating a brand new project and just installed Laravel's latest version.

We're just testing the waters and created a very simple webpack.mix.js file:

const mix = require('laravel-mix');
mix.js('resources/js/jquery-3.1.1.min.js', 'public/js');

When we run "npm run dev", this is what we get:

> @ dev /home/mhdev/maplemain
> npm run development


> @ development /home/mhdev/maplemain
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

Nothing else happens even after 10 minutes. We never had this run successfully before but we don't think it should run for such a long time without feedback, especially considering that it's only 1 simple js file.

We're running npm v6.14.4 and node v12.16.2.

Things we've tried:

rm -rf node_modules package-lock.json
npm cache clear --force
npm install cross-env
npm install

We also tried running it with verbose and it shows:

[mhdev@server20 maplemain]$ npm run dev --verbose
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'dev', '--verbose' ]
npm info using [email protected]
npm info using [email protected]
npm verb run-script [ 'predev', 'dev', 'postdev' ]
npm info lifecycle @~predev: @
npm info lifecycle @~dev: @

> @ dev /home/mhdev/maplemain
> npm run development

npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'development' ]
npm info using [email protected]
npm info using [email protected]
npm verb run-script [ 'predevelopment', 'development', 'postdevelopment' ]
npm info lifecycle @~predevelopment: @
npm info lifecycle @~development: @

> @ development /home/mhdev/maplemain
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

No luck.

Since we're so brand new to Mix and Webpack, any and all help will be greatly appreciated!

Thanks in advance!

0 likes
3 replies
keizah7's avatar

Show us, how you inserted jquery-3.1.1.min.js to view. Did you close <script> tag properly?

npm run watch stucks also?

morhsn's avatar

Hey everyone,

We figured the issue out. Hopefully, this can help people in the future!

The Linux account through which we were running the npm run dev from was under a jailshell. Once we removed that and enabled regular bash shell for the account under cPanel/WHM - it worked as expected.

Thanks Keizah for trying to help!

slumdog's avatar

I'm having the same problem on a shared hosting with cPanel. No jailed shell.


> @ dev /home/simplidocs/public_html/laravel
> npm run development


> @ development /home/simplidocs/public_html/laravel
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

Fresh install of Laravel. I don't know why cPanel offers only nodejs 10. I have opened a ticket to them to ask how to run the latest nodejs.

Please or to participate in this conversation.