foundation-cli icon indicating copy to clipboard operation
foundation-cli copied to clipboard

Watch error after updating CLI

Open MichaelJPDX opened this issue 7 years ago • 8 comments

Noticed there was a CLI update available (current 2.2.1, new 2.2.3) but after updating through npm I get the following error trying to run watch in a project:

/usr/local/lib/node_modules/foundation-cli/lib/commands/info.js:7
module.exports = function(args = {}) {
                               ^

SyntaxError: Unexpected token =
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/foundation-cli/lib/index.js:4:9)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

I noticed some warnings about bower and terminal-kit when I updated, but it appeared to complete okay. Any idea how to fix this?

MichaelJPDX avatar May 26 '17 17:05 MichaelJPDX

I am getting the same error. I thought it might have been an issue on my Mac, so I uninstalled/reinstalled Node and NPM, and the CLI, but am still getting the same error. Tried on a secondary Mac and am getting the same error.

bpcoxjr avatar May 26 '17 20:05 bpcoxjr

Hey @MichaelJPDX and @bpcoxjr -thanks for the bug report! Can ya'all let us know what version of node you're using? (CC @paxperscientiam)

kball avatar May 26 '17 20:05 kball

Thanks for the quick response @kball. I'm running node v4.5.0 on both of my machines.

bpcoxjr avatar May 26 '17 20:05 bpcoxjr

I'm able to reproduce this bug in 4.5.0... it works find in 6 series, so this is probably a feature of ES2016 that wasn't supported in earlier node versions. @paxperscientiam can you take a look at fixing?

@bpcoxjr a workaround in the meantime would be to update to 6 series node... for what it's work, I use (and highly recommend) nvm (https://github.com/creationix/nvm) to manage multiple node versions

kball avatar May 26 '17 20:05 kball

Thanks @kball. I downloaded NVM and changed the version of node I was operating on it works now!

bpcoxjr avatar May 26 '17 20:05 bpcoxjr

Looks like I've got 4.6.1. I'll try upgrading. Thanks for the help!

On Fri, May 26, 2017 at 1:38 PM, Patrick Cox [email protected] wrote:

Thanks @kball https://github.com/kball. I downloaded NVM and changed the version of node I was operating on it works now!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zurb/foundation-cli/issues/68#issuecomment-304382938, or mute the thread https://github.com/notifications/unsubscribe-auth/AHsAgti8Cuq82FVZ2ns2clCMIEpmSvjIks5r9zg1gaJpZM4Nn3F- .

MichaelJPDX avatar May 26 '17 20:05 MichaelJPDX

Hi @kball I'm using a pretty recent version -- node v7.10.0

EDIT: Taking a look!

EDIT2: @MichaelJPDX if you decide not to upgrade, this should be fixed by PR #70

paxperscientiam avatar Jun 03 '17 05:06 paxperscientiam

Same error here (Ubuntu 14.04.5 LTS and Linux Mint 17.3), node 4.8.3 installed from distro repos. I was trying to upgrade foundation-cli from 2.2.2 to 2.2.3. I still have several Foundation 6.2/6.3 based sites, what will break if I upgrade Node?

Well, I gave it a try and installed Node 6.11.0. Error above is gone, trying out the rest …

EDIT: Note for other colleagues out there:

In older project folders (made with F6.2/6.3 and Node 4.8.3), I had to: npm update npm rebuild before foundation watch and foundation build worked again. Otherwise, nothing seems to have broken. Phew

Moonbase59 avatar Jun 13 '17 18:06 Moonbase59