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

tptompkins's avatar

Spark or Elixir issue?

I followed the instructions in the docs for installing Spark using the spark-installer and I got it installed in Homestead:

localhost:~ tommytompkins$ homestead --version
Laravel Homestead version 2.2.1

vagrant@homestead:~$ spark
Laravel Spark Installer version 1.0.2

I also ran php artisan migrate and didn't have any issues. After I got it installed, I was able to load the main Spark site with the Spark logo but when I click on the Login button or Register button I get a blank screen.

I ran gulp and noticed the following error:

[01:34:15] gulp-notify: [Laravel Elixir] Browserify Failed!: Couldn't find preset "es2015" relative to directory "/home/vagrant/Code/sparktest/resources/assets/js" while parsing file: /home/vagrant/Code/sparktest/resources/assets/js/app.js
{ [Error: Couldn't find preset "es2015" relative to directory "/home/vagrant/Code/sparktest/resources/assets/js" while parsing file: /home/vagrant/Code/sparktest/resources/assets/js/app.js]
  filename: '/home/vagrant/Code/sparktest/resources/assets/js/app.js',
  stream: 
   Labeled {
     _readableState: 
      ReadableState {
        highWaterMark: 16,
        buffer: [],
        length: 0,
        pipes: [Object],
        pipesCount: 1,
        flowing: true,
        ended: false,
        endEmitted: false,
        reading: true,
        sync: false,
        needReadable: true,
        emittedReadable: false,
        readableListening: false,
        objectMode: true,
        defaultEncoding: 'utf8',
        ranOut: false,
        awaitDrain: 0,
        readingMore: false,
        decoder: null,
        encoding: null,
        resumeScheduled: false },
     readable: true,
     domain: null,
     _events: 
      { end: [Object],
        error: [Object],
        data: [Function: ondata],
        _mutate: [Object] },
     _eventsCount: 4,
     _maxListeners: undefined,
     _writableState: 
      WritableState {
        highWaterMark: 16,
        objectMode: true,
        needDrain: false,
        ending: true,
        ended: true,
        finished: true,
        decodeStrings: true,
        defaultEncoding: 'utf8',
        length: 0,
        writing: false,
        corked: 0,
        sync: false,
        bufferProcessing: false,
        onwrite: [Function],
        writecb: null,
        writelen: 0,
        buffer: [],
        pendingcb: 0,
        prefinished: true,
        errorEmitted: false },
     writable: true,
     allowHalfOpen: true,
     _options: { objectMode: true },
     _wrapOptions: { objectMode: true },
     _streams: [ [Object] ],
     length: 1,
     label: 'deps' } }
[01:34:15] Finished 'browserify' after 2.87 s
[01:34:15] Starting 'copy'...

Any idea what's going on or how I can fix this?

0 likes
7 replies
noeldiaz's avatar

@tptompkins Did your npm install finish correctly? Maybe it didn't get all the necessary libraries? You could try running it again with "npm install --save" and then try gulp again?

tptompkins's avatar

Before, I was running npm install then gulp. I just ran npm install --save (not sure what the difference is) then gulp and I still have the same error.

jekinney's avatar

That is elixir issue with dependencies . You need to npm install es2015. (Google it for exact code). You will probably get another error after. Same deal. Google the npm package.

I got that error on my Mac awhile back. Obviously you didn't google the error because it took me about 3 minutes to google and fix.

https://www.npmjs.com/package/babel-preset-es2015

tptompkins's avatar

@jekinney Actually, I did google the error and found this:

https://github.com/laravel/elixir/issues/354

And others that said to run: npm install babel-preset-es2015 babel-preset-react --save

I ran that and it didn't help. I also ran npm install --save-dev babel-preset-es2015 which didn't help either (from your link). I've been trying to figure this out for a couple of hours now :/

tptompkins's avatar
tptompkins
OP
Best Answer
Level 7

In order to solve this issue, I had to upgrade node and npm inside Homestead like so:

homestead ssh
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
npm install -g npm

// Reboot the VM
homestead halt
homestead up

// Check versions
vagrant@homestead:~/Code/sparktest$ npm -v
3.8.3
vagrant@homestead:~/Code/sparktest$ node -v
v5.10.1

// install the missing presets
npm install babel-preset-es2015 --save
npm install babel-preset-react --save

// run gulp
vagrant@homestead:~/Code/sparktest$ gulp

BOOM! Finally fixed and now I can load the Login and Register screens. :)

6 likes

Please or to participate in this conversation.