Unable to run example - Module '"http"' has no exported member 'ServerRequest'
shakthihcue opened this issue ยท 7 comments
Description/Steps to reproduce
npm run on windows throws below error:
Module '"http"' has no exported member 'ServerRequest'
Expected result
Example to build and run successfully
Additional information
package.json was throwing error on postinstall and hence it has been changed as below:
"postinstall": "cd services/account && npm i && cd ../customer && npm i && cd ../transaction && npm i && cd ../facade && npm i",
#Environment information
OS: Windows 10
Node: v 8.9.0
I work around by add
"compilerOptions": {
"skipLibCheck": true
}
to tsconfig.json
@SourCreamz This work for me. Thanks man!!!!
@shakthihcue Can you try used @SourCreamz decisions?
Update express-serve-static-core to latest version
npm install @types/express-serve-static-core@4.16.2 --save
I continue to get this error on Mac, despite using all of the recommended solutions above.
Is the README incomplete?
I run npm i
, and then i run npm run postinstall
( or ./bin/install ).
Running npm start
throws the error in this ticket multiple (7) times.
EDIT: Using Node v10.15.3
Still getting error i tried above solutions
I am wondering that none can run this example :(
http.ServerRequest is wrong.
There is no method like ServerRequest but ClientRequest.
So I modified ServerRequest to ClientRequest and it worked.
Had this issue, for anyone coming here.
Make sure you don't have npm package express-serve-static-core
,
Just make sure you only have @types/express-serve-static-core
I believe the issue is that typescript will find express-serve-static-core
npm package, and then does not try and find the types in @types/express-serve-static-core