Skip to content

Npm build reports an error

Hello! I tried building a new version of red-x following the README file. npm install went okay, but npm run webextension returned this error message:

> red-x@0.1.0 webextension /home/tirifto/Stažené/red-x-master
> npm run tsc && npm run browserify-webextension && npm run zip-webextension


> red-x@0.1.0 tsc /home/tirifto/Stažené/red-x-master
> tsc

src/desktopengine/RedditElements.ts:465:30 - error TS2352: Conversion of type 'HTMLCollectionOf<Element>' to type 'NodeListOf<HTMLAnchorElement>' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
  Type 'HTMLCollectionOf<Element>' is missing the following properties from type 'NodeListOf<HTMLAnchorElement>': forEach, entries, keys, values

465         let flatListItems = (<NodeListOf<HTMLAnchorElement>>(
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
466      commentElement.getElementsByClassName("Comment_FlatList")[0].
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
467  	getElementsByClassName("CommentFlastList__item")));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! red-x@0.1.0 tsc: `tsc`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the red-x@0.1.0 tsc 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/tirifto/.npm/_logs/2019-02-01T08_21_40_734Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! red-x@0.1.0 webextension: `npm run tsc && npm run browserify-webextension && npm run zip-webextension`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the red-x@0.1.0 webextension 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/tirifto/.npm/_logs/2019-02-01T08_21_41_060Z-debug.log

I also attach the two log files referenced in the error message:

This was done today on Parabola GNU+Linux-libre (based on Arch Linux), with the following dependencies installed:

  • nodejs 11.8.0-1
  • npm 6.7.0-1
  • typescript 3.2.4-1
  • browserify 16.2.3-1

I figure the build has failed, but I'm not sure as I don't know what the expected result should have been, and I have no prior experience with Node et al. (A webextension file should be made, I suppose?)