netlify / headlesscms.org

Source for headlesscms.org
https://headlesscms.org/
MIT License
626 stars 150 forks source link

'npm start' fails on clean install #289

Open topherzee opened 4 years ago

topherzee commented 4 years ago

Hi, I just cloned the repo and ran npm install And then ran npm start. It failed with this message:

> headlesscms@2.0.0 start /Users/cz/Documents/a-projects/headlesscms_org/test/headlesscms.org
> react-static start

=> Building Routes...
Local archive not found, fetching new data.
[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4
  Error: Token authentication requires a token to be set

  - authenticate.js:25 authenticate
    [headlesscms.org]/[@octokit]/rest/lib/plugins/authentication/authenticate.js:25:15

  - fetch-archive.js:24 authenticate
    /Users/cz/Documents/a-projects/headlesscms_org/test/headlesscms.org/scripts/fetch-archive.js:24:11

  - fetch-archive.js:137 _callee8$
    /Users/cz/Documents/a-projects/headlesscms_org/test/headlesscms.org/scripts/fetch-archive.js:137:3

  - runtime.js:62 tryCatch
    [headlesscms.org]/[babel-runtime]/[regenerator-runtime]/runtime.js:62:40

  - runtime.js:296 Generator.invoke [as _invoke]
    [headlesscms.org]/[babel-runtime]/[regenerator-runtime]/runtime.js:296:22

  - runtime.js:114 Generator.prototype.<computed> [as next]
    [headlesscms.org]/[babel-runtime]/[regenerator-runtime]/runtime.js:114:21

  - fetch-archive.js:383 step
    /Users/cz/Documents/a-projects/headlesscms_org/test/headlesscms.org/scripts/fetch-archive.js:383:191

  - fetch-archive.js:383 
    /Users/cz/Documents/a-projects/headlesscms_org/test/headlesscms.org/scripts/fetch-archive.js:383:361

I had had some errors when running npm install, so I deleted the package-lock.json and installed again and it installed with no errors. However, npm start gave the same results.

I updated to latest node (13.12.0) and npm (6.14.4), but no change in behaviour.

Help! :)

topherzee commented 4 years ago

Well, a brute force 'fix' is to comment out lines 137-138 of /scripts/fetch-archive.js. I guess its expecting an .env file to be configured. But that's not how readme describes it. Would be great if it can handle no .env file being there.