foundation/foundation-cli

foundation new fails with SyntaxError: Unexpected token =

Closed this issue ยท 12 comments

C:>npm --v foundation-cli
3.5.0

C:\inetpub\wwwroot\sites>foundation new
C:\Users\Username\AppData\Roaming\npm\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:414:25)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (C:\Users\Username\AppData\Roaming\npm\node_modules\foundation-cli\lib\index.js:4:9)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)

For the time being (to be able to create a new foundation site):

npm uninstall -g foundation-cli

npm install -g foundation-cli@2.2.2

Same issue with my installation after updating to 2.2.5. @RandalMc's advice to uninstall and reinstall 2.2.2 has sorted this problem out.

I just tried this using Cloud9 and got an error with 2.2.5 but it wasn't the "=" it was "*". Going to 2.2.2 did the trick. Thank You!

For the time being (to be able to create a new foundation site):

npm uninstall -g foundation-cli

npm install -g foundation-cli@2.2.2

Still the best solution as of Nov '18.

@RandalMc @jimgroome @nmastroianni @fbscott

Hi ๐Ÿ‘‹, sorry for the late reply.

Could you tell me what version of Node you are running on ?

@ncoden

C:\Users\RandalMc>node -v
v5.12.0

Updating node.js solved my problem.

Now v6.11.0. Can't recall what it was a month and a half ago when I was having this issue.

npm install -g foundation-cli@2.2.2 helped me with upgraded npm. Thanks

Still having the same issue

@SpyceTewan please provide some information about your Node version. You can switch to another using nodenv, nvm, n, ...

Default function parameters were introduced in later Node versions starting with 6.x.

See https://node.green/

Closing as old versions of Node should not be used anymore as they reached their EOL.