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

boldstar's avatar

package-lock.json causing conflicts when deploying on laravel forge

I am getting the following alarm when try to deploy my recent changes.

* branch            master     -> FETCH_HEAD
   91a3da8..c01f5d1  master     -> origin/master
error: Your local changes to the following files would be overwritten by merge:
    package-lock.json
Please commit your changes or stash them before you merge.
Aborting
Updating 716952a..c01f5d1

This is my current build script

git pull origin master
npm install
composer install --no-interaction --prefer-dist --optimize-autoloader
echo "" | sudo -S service php7.3-fpm reload

if [ -f artisan ]
then
    php artisan migrate --force
fi

I have tried multiple ways of getting around this issue but nothing has worked. Any help would be greatly appreciated!

0 likes
2 replies
boldstar's avatar
boldstar
OP
Best Answer
Level 2

Nevermind I just ssh into server and fixed the merge conflicts. Lol

Sledmore's avatar

@BOLDSTAR - Yup, all this means is that the packages were probably updated on the server at one point, and not in sync with Git. Clearing the lock file is safe.

Please or to participate in this conversation.