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

Ligonsker's avatar

Does blank Laravel 9 project need to use npm?

I created a blank Laravel 9 project without running npm install yet, and looks like everything was working fine. But of course that's just an empty project

Then I ran npm install and it installed a lot of node_modules. Do I have to install them? What are the default node_modules used for?

0 likes
5 replies
Sinnbeck's avatar

Only if you plan to compile your css/js. You can just write it directly in /public/css for example and then import it manually with a <link tag (same with js)

1 like
Ligonsker's avatar

@Sinnbeck Oh I already see the headache of me trying to compile things - remember the other post about composer and blocked traffic.. it will be the same story with npm haha. I guess I'll just do it manually

**Although they do have special private repo for Node (Nexus)

Sinnbeck's avatar

@Ligonsker Well if you can always download jquery or similar if you need it, and just load it from a script tag. Thats how it was done when I started coding :)

1 like
Ligonsker's avatar

@Sinnbeck haha that's what I'll do. I am just confused because, there are so many modules installed in node_modules, so all of them are just maybe for vite to work properly?

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@Ligonsker Yeah just vite, axios (for ajax requests), lodash for mutating data and postcss for compiling css.

1 like

Please or to participate in this conversation.