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

midascodebreaker's avatar

Is there a Way to Cache npm install like using 'laravel new blog' / composer install?

If we are going to use All Laravel Elixir Dependancy... is there a way to cache or load it in cache once we install it? Like When we use laravel installer, once it dowloads all the packages it cached the packages so when next time you use the command laravel new ProjectName. It Will Be Faster....

Has Anyone Already think of this? Coz its kinda time consuming downloading same packages..

0 likes
1 reply
ohffs's avatar

You could tar up the node_modules directory then just un-tar it in the next project I guess. Eg:

tar -czf ~/node_laravel.tgz node_modules

then when you create a new project just do :

tar -xzf ~/node_laravel.tgz

I'm entirely guessing if that works ok for npm though :-)

Please or to participate in this conversation.