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

Ilya_user's avatar

Cannot use npm commands in a deployed project

I deployed laravel project and I have this error because of my bootstrap registration: Run npm run dev in your terminal and refresh the page. The problem is that I can't use that command with an already deployed project and I also wasn't successful in installing npm too. How Can I fix it? This is my first time deploying a project so it's all new to me. I read that I should delete package-lock.json then reinstall via npm install before deploying a project. But it did nothing for me.

0 likes
9 replies
Sinnbeck's avatar

In production you should use npm run build

What happens when you do?

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@Ilya_user ok. You can ask them if try can enable/install it. If not, you need to run it locally and upload /public/build

1 like
Ilya_user's avatar

@Sinnbeck would npm run build create /public/build or I should create those folders myself?

Sinnbeck's avatar

@Ilya_user it creates them automatically (public already exist). I assume you are using vite?

Please or to participate in this conversation.