Strider-CD / strider

Open Source Continuous Integration & Deployment Server
http://strider-cd.github.io/
4.59k stars 432 forks source link

Build fails: Cannot find type definition file for 'express-session' #1090

Closed selfagency closed 4 years ago

selfagency commented 4 years ago

Build fails. You need to explicitly require @types/express-session in package.json.

> strider@2.4.1 postinstall /var/www/selfagency-ci/live
> npm run build-lib && opencollective postinstall

> strider@2.4.1 build-lib /var/www/selfagency-ci/live
> npm run build-ts && npm run lint-lib && npm run copy-static-assets

> strider@2.4.1 build-ts /var/www/selfagency-ci/live
> tsc

node_modules/connect-mongo/src/types.d.ts:8:23 - error TS2688: Cannot find type definition file for 'express-session'.

8 /// <reference types="express-session" />
                        ~~~~~~~~~~~~~~~

node_modules/connect-mongo/src/types.d.ts:13:26 - error TS7016: Could not find a declaration file for module 'express-session'. '/var/www/selfagency-ci/live/node_modules/express-session/index.js' implicitly has an 'any' type.
  Try `npm install @types/express-session` if it exists or add a new declaration (.d.ts) file containing `declare module 'express-session';`

13 import * as session from 'express-session';
                            ~~~~~~~~~~~~~~~~~

node_modules/connect-mongo/src/types.d.ts:113:66 - error TS2694: Namespace 'global.Express' has no exported member 'SessionData'.

113         get: (sid: string, callback: (err: any, session: Express.SessionData | null) => void) => void;
                                                                     ~~~~~~~~~~~

node_modules/connect-mongo/src/types.d.ts:114:45 - error TS2694: Namespace 'global.Express' has no exported member 'SessionData'.

114         set: (sid: string, session: Express.SessionData, callback?: (err: any) => void) => void;
                                                ~~~~~~~~~~~

node_modules/connect-mongo/src/types.d.ts:118:47 - error TS2694: Namespace 'global.Express' has no exported member 'SessionData'.

118         touch: (sid: string, session: Express.SessionData, callback?: (err: any) => void) => void;
                                                  ~~~~~~~~~~~

Found 5 errors.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! strider@2.4.1 build-ts: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the strider@2.4.1 build-ts 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/selfagency/.npm/_logs/2020-05-02T04_54_30_244Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! strider@2.4.1 build-lib: `npm run build-ts && npm run lint-lib && npm run copy-static-assets`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the strider@2.4.1 build-lib 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/selfagency/.npm/_logs/2020-05-02T04_54_30_270Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! strider@2.4.1 postinstall: `npm run build-lib && opencollective postinstall`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the strider@2.4.1 postinstall 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/selfagency/.npm/_logs/2020-05-02T04_54_30_438Z-debug.log
scottlet commented 4 years ago

Same issue here

selfagency commented 4 years ago

A temporary resolution is to run npm install @types/express-session, then erase node_modules and package-lock.json, and re-run npm install.

scottlet commented 4 years ago

thanks, that worked

knownasilya commented 4 years ago

Weird that I don't get that error, maybe I forgot to add it to the package locally. Fixing.

knownasilya commented 4 years ago

Should be fixed in v2.4.2