rhysd / node-github-trend

node.js library for scraping GitHub trending repositories.
MIT License
20 stars 3 forks source link

Add build instructions #7

Closed madnight closed 7 years ago

madnight commented 7 years ago

I tried to build the library but get several errors:

git clone https://github.com/rhysd/node-github-trend.git && cd node-github-trend && npm run build

src/lib.d.ts(1,22): error TS6053: File '/home/x/Git/node-github-trend/typings/tsd.d.ts' not found.
src/main.ts(1,26): error TS7016: Could not find a declaration file for module 'request'. '/home/x/Git/node-github-trend/node_modules/request/index.js' implicitly has an 'any' type.
  Try `npm install @types/request` if it exists or add a new declaration (.d.ts) file containing `declare module 'request';`
src/main.ts(2,26): error TS7016: Could not find a declaration file for module 'cheerio'. '/home/x/Git/node-github-trend/node_modules/cheerio/index.js' implicitly has an 'any' type.
  Try `npm install @types/cheerio` if it exists or add a new declaration (.d.ts) file containing `declare module 'cheerio';`
src/main.ts(3,23): error TS7016: Could not find a declaration file for module 'js-yaml'. '/home/x/Git/node-github-trend/node_modules/js-yaml/index.js' implicitly has an 'any' type.
  Try `npm install @types/js-yaml` if it exists or add a new declaration (.d.ts) file containing `declare module 'js-yaml';`
src/main.ts(66,20): error TS2693: 'Promise' only refers to a type, but is being used as a value here.
src/main.ts(66,29): error TS7006: Parameter 'resolve' implicitly has an 'any' type.
src/main.ts(66,38): error TS7006: Parameter 'reject' implicitly has an 'any' type.
src/main.ts(67,28): error TS7006: Parameter 'err' implicitly has an 'any' type.
src/main.ts(67,33): error TS7006: Parameter 'res' implicitly has an 'any' type.
src/main.ts(67,38): error TS7006: Parameter 'body' implicitly has an 'any' type.
src/main.ts(88,32): error TS7006: Parameter 'li' implicitly has an 'any' type.
src/main.ts(88,36): error TS7006: Parameter 'i' implicitly has an 'any' type.
src/main.ts(169,20): error TS2693: 'Promise' only refers to a type, but is being used as a value here.
src/main.ts(172,20): error TS2693: 'Promise' only refers to a type, but is being used as a value here.
src/main.ts(172,29): error TS7006: Parameter 'resolve' implicitly has an 'any' type.
src/main.ts(172,38): error TS7006: Parameter 'reject' implicitly has an 'any' type.
src/main.ts(181,28): error TS7006: Parameter 'err' implicitly has an 'any' type.
src/main.ts(181,33): error TS7006: Parameter 'res' implicitly has an 'any' type.
src/main.ts(181,38): error TS7006: Parameter 'body' implicitly has an 'any' type.
src/main.ts(248,20): error TS2693: 'Promise' only refers to a type, but is being used as a value here.
src/main.ts(248,29): error TS7006: Parameter 'resolve' implicitly has an 'any' type.
src/main.ts(248,38): error TS7006: Parameter 'reject' implicitly has an 'any' type.
src/main.ts(267,28): error TS7006: Parameter 'err' implicitly has an 'any' type.
src/main.ts(267,33): error TS7006: Parameter 'res' implicitly has an 'any' type.
src/main.ts(267,38): error TS7006: Parameter 'body' implicitly has an 'any' type.
src/main.ts(296,20): error TS2693: 'Promise' only refers to a type, but is being used as a value here.
src/main.ts(301,20): error TS2693: 'Promise' only refers to a type, but is being used as a value here.
src/main.ts(301,28): error TS7006: Parameter 'resolve' implicitly has an 'any' type.
src/main.ts(312,28): error TS7006: Parameter 'err' implicitly has an 'any' type.
src/main.ts(312,33): error TS7006: Parameter 'res' implicitly has an 'any' type.
src/main.ts(312,38): error TS7006: Parameter '_' implicitly has an 'any' type.
src/main.ts(335,20): error TS2693: 'Promise' only refers to a type, but is being used as a value here.
src/main.ts(346,16): error TS2693: 'Promise' only refers to a type, but is being used as a value here.
src/main.ts(363,16): error TS2693: 'Promise' only refers to a type, but is being used as a value here.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! github-trend@0.1.0 build: `tsc -p src/`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github-trend@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/x/.npm/_logs/2017-09-10T13_27_54_833Z-debug.log

I also tried yarn global add tsd && tsd instadd && npm run build

node_modules/typescript/lib/lib.d.ts(1288,11): error TS2428: All declarations of 'Promise' must have identical type parameters.
node_modules/typescript/lib/lib.d.ts(1295,211): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(1302,112): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(5418,14): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(5438,124): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(5439,15): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(5445,16): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(5604,32): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(5605,38): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(5606,64): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(5608,63): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(5610,52): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(5619,32): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(5620,29): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(5622,63): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(5623,30): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(9852,13): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(9853,48): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(11401,56): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(11461,51): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(11470,22): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(11474,14): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(11475,59): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(11476,30): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(11477,15): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(11478,28): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(11500,24): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(11640,59): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(11773,52): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(11834,99): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(11835,103): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(12315,109): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(12475,67): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(12546,23): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(12547,35): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(12662,14): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(12663,13): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(12674,19): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(12690,41): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13016,24): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13017,61): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13018,55): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13031,20): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13095,15): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13105,15): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13106,13): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13331,132): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13334,118): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13335,144): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13339,136): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13342,144): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13343,145): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13449,17): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13450,19): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13597,21): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13598,45): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13600,68): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13636,69): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13637,19): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(13638,15): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(15661,28): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(16037,72): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(16038,160): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(17376,169): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(17377,217): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(17577,20): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(17578,13): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(17579,13): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(17580,13): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(17581,17): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(17722,52): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(18719,182): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(18720,230): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
node_modules/typescript/lib/lib.d.ts(18751,65): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
src/main.ts(85,33): error TS2339: Property 'load' does not exist on type 'typeof "cheerio"'.
src/main.ts(88,32): error TS7006: Parameter 'li' implicitly has an 'any' type.
src/main.ts(88,36): error TS7006: Parameter 'i' implicitly has an 'any' type.
src/main.ts(150,33): error TS2339: Property 'load' does not exist on type 'typeof "cheerio"'.
src/main.ts(292,27): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
src/main.ts(331,27): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
src/main.ts(340,23): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
src/main.ts(357,23): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
typings/es6-promise/es6-promise.d.ts(11,15): error TS2428: All declarations of 'Promise' must have identical type parameters.
typings/es6-promise/es6-promise.d.ts(31,105): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
typings/es6-promise/es6-promise.d.ts(32,94): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
typings/es6-promise/es6-promise.d.ts(39,58): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
typings/es6-promise/es6-promise.d.ts(47,48): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
typings/es6-promise/es6-promise.d.ts(52,31): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
typings/es6-promise/es6-promise.d.ts(59,50): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
typings/es6-promise/es6-promise.d.ts(64,51): error TS2314: Generic type 'Promise<T, R>' requires 2 type argument(s).
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! github-trend@0.1.0 build: `tsc -p src/`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github-trend@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/x/.npm/_logs/2017-09-10T13_38_17_409Z-debug.log

Maybe i do something wrong or miss something, but unfortunately there are no build instructions.

rhysd commented 7 years ago

Now this repository contains type definition files and only executing npm run build should be able to build this package.