Build fails: Cannot find type definition file for 'express-session'
selfagency opened this issue · 5 comments
selfagency commented
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
scottbert commented
Same issue here
selfagency commented
A temporary resolution is to run npm install @types/express-session
, then erase node_modules
and package-lock.json
, and re-run npm install
.
scottbert commented
thanks, that worked
knownasilya commented
Weird that I don't get that error, maybe I forgot to add it to the package locally. Fixing.
knownasilya commented
Should be fixed in v2.4.2