DEV Community

Discussion on: How to deploy a Laravel/Vue App to Heroku

Collapse
 
saidichlil profile image
saidichlil

remote: Skipping 'fsevents' build as platform linux is not supported
remote: npm ERR! Cannot read property 'length' of undefined
remote:

remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.Ta3zs/_logs/2020-06-01T23_28_55_378Z-debug.log

Collapse
 
abduroza profile image
Muhammad Abdurrozaq

insert code below to scripts in package.json
"scripts": {
"heroku-prebuild": "npm install -f",
"heroku-postbuild": "npm run build"
}

Collapse
 
smplyjr profile image
Jr Flores • Edited

Still getting the error after adding the scripts. And what npm run build supposed to be doing? Laravel's package.json scripts by default only has dev, watch and prod.

I am not sure if build is an old key for prod. Please correct me if I'm wrong.

Thread Thread
 
axis80 profile image
axis80 • Edited

I got it working using this:

    "postinstall": "npm run production",
    "heroku-prebuild": "npm install -f",
    "heroku-postbuild": "npm run production"
Enter fullscreen mode Exit fullscreen mode

That rebuilt the assets multiple times, so I trimmed it down to just this and it seems to be all that is needed. At least, it is working for me now:

"heroku-postbuild": "npm run production"
Enter fullscreen mode Exit fullscreen mode