headlesscms.org icon indicating copy to clipboard operation
headlesscms.org copied to clipboard

'npm start' fails on clean install

Open topherzee opened this issue 5 years ago • 1 comments

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

> [email protected] 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 avatar Apr 01 '20 15:04 topherzee

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.

topherzee avatar Apr 01 '20 16:04 topherzee