Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot start app: Error: Token authentication requires a token to be set #9

Closed
ljones87 opened this issue Jun 3, 2019 · 2 comments
Closed

Comments

@ljones87
Copy link

ljones87 commented Jun 3, 2019

Please see below issue. I had this problem initially, then deleted the repo and started again, no improvement. Steps documenting install and subsequent error message is below.
Thank you.

user@K1HV2F  ~/References $ git clone https://github.com/FrontendMasters/advanced-graphql.git
Cloning into 'advanced-graphql'...
remote: Enumerating objects: 211, done.
remote: Total 211 (delta 0), reused 0 (delta 0), pack-reused 211
Receiving objects: 100% (211/211), 68.72 KiB | 1.06 MiB/s, done.
Resolving deltas: 100% (112/112), done.
user@K1HV2F ~/References $ ls
Advanced-React		advanced-graphql
user@K1HV2F ~/References $ cd advanced-graphql/
user@K1HV2F ~/References/advanced-graphql(master) $ ls
README.md	package.json	tests
nodemon.json	src		yarn.lock
user@K1HV2F ~/References/advanced-graphql(master) $ yarn install
yarn install v1.9.4
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
error upath@1.0.4: The engine "node" is incompatible with this module. Expected version ">=4 <=9".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
user@K1HV2F ~/References/advanced-graphql(master) $ yarn dev
yarn run v1.9.4
$ nodemon src/server
/bin/sh: nodemon: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
user@K1HV2F ~/References/advanced-graphql(master) $ npm install
npm WARN deprecated apollo-upload-server@7.1.0: Please migrate to https://npm.im/graphql-upload (see https://git.io/fADhl).
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()

> fsevents@1.2.9 install /Users/user/References/advanced-graphql/node_modules/fsevents
> node install

node-pre-gyp WARN Using request for node-pre-gyp https download
[fsevents] Success: "/Users/user/References/advanced-graphql/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" is installed via remote

> core-js@2.6.9 postinstall /Users/user/References/advanced-graphql/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> nodemon@1.19.1 postinstall /Users/user/References/advanced-graphql/node_modules/nodemon
> node bin/postinstall || exit 0

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN graphql-middleware@3.0.2 requires a peer of graphql@^14.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN adv-gql@1.0.0 No repository field.

added 895 packages from 589 contributors and audited 19509 packages in 15.661s
found 63 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
user@K1HV2F ~/References/advanced-graphql(master) $ npm run dev

> adv-gql@1.0.0 dev /Users/user/References/advanced-graphql
> nodemon src/server

[nodemon] 1.19.1
[nodemon] reading config ./nodemon.json
[nodemon] to restart at any time, enter `rs`
[nodemon] or send SIGHUP to 22355 to restart
[nodemon] watching: src/**/* index.js config.js
[nodemon] watching extensions: js,json,graphql
[nodemon] forking
[nodemon] child pid: 22357
[nodemon] watching 18 files
[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4
/Users/user/References/advanced-graphql/node_modules/@octokit/rest/lib/plugins/authentication/authenticate.js:26
        throw new Error('Token authentication requires a token to be set')
        ^

Error: Token authentication requires a token to be set
    at authenticate (/Users/user/References/advanced-graphql/node_modules/@octokit/rest/lib/plugins/authentication/authenticate.js:26:15)
    at Object.<anonymous> (/Users/user/References/advanced-graphql/src/api/github.js:4:11)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/Users/user/References/advanced-graphql/src/api/loaders.js:4:25)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:690:17)
[nodemon] app crashed - waiting for file changes before starting...

@hagnerd
Copy link

hagnerd commented Aug 27, 2019

Hey I know it has been a while since you opened up this issue but did you ever get it resolved? If not, I believe the step you are missing is to add a .env file with your GITHUB_TOKEN set inside of it. The .env-sample should show you an example of what it looks like.

@gregknudsen-zz
Copy link

Hi @ljones87
I had this exact same error, and I believe I just fixed it. First off, my .env was not in the top level of the repo. Once I moved it up a folder, I received a different error. And this error was corrected by just populating the project.graphql with a simple schema. If you run yarn dev and navigate to localhost:5000/docs, it should work now.

Hope this helps!

@1Marc 1Marc closed this as completed Nov 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants