forestryio / create-static-site

Create static websites with no build configuration.
MIT License
135 stars 10 forks source link

Hugo template installation fails #21

Closed Germoe closed 6 years ago

Germoe commented 6 years ago

When using the npx create-static-site --template hugo my-hugo-site command (with no other preparation and the environment listed below) the installation failed. It throws the following error:

...
  ✔ Hugo binary is installed successfully
+ static-scripts@0.1.0
added 1951 packages in 133.253s

Aborting installation.
Unexpected error. Please report it as a bug:
/Users/Grayson/Google_Drive/Freelance/Forestry.io/create-static-site/my-hugo-site/node_modules/static-scripts/scripts/init.js:42
      ...appPackage.dependencies,
      ^^^
SyntaxError: Unexpected token ...
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at getPackageName.then.then.then.packageName (/Users/Grayson/.npm/_npx/15434/lib/node_modules/create-static-site/createStaticSite.js:333:20)

Deleting generated file... node_modules
Deleting generated file... package.json
Done.

Environment:

I hope this is enough information to figure out the issue. If you need the entire cli output or any other information, I'd be happy to provide it.

ncphillips commented 6 years ago

Thank you @Germoe! I believe I know the cause. I'll look into this shortly.

ncphillips commented 6 years ago

This was caused by Node 6 not supporting the object spread notation.

Should be fixed in #24 and will be released in static-scripts@0.1.1