loopback4-example-microservices icon indicating copy to clipboard operation
loopback4-example-microservices copied to clipboard

Unable to run example - Module '"http"' has no exported member 'ServerRequest'

Open shakthihcue opened this issue 6 years ago • 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

shakthihcue avatar Nov 05 '18 09:11 shakthihcue

I work around by add "compilerOptions": { "skipLibCheck": true } to tsconfig.json

SourCreamz avatar Dec 03 '18 09:12 SourCreamz

@SourCreamz This work for me. Thanks man!!!! @shakthihcue Can you try used @SourCreamz decisions?

pavelgronsky avatar Mar 19 '19 15:03 pavelgronsky

Update express-serve-static-core to latest version

npm install @types/[email protected] --save

MiguelSavignano avatar Apr 22 '19 13:04 MiguelSavignano

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

trevormaustin avatar May 08 '19 20:05 trevormaustin

Still getting error i tried above solutions

pawarvijay avatar May 17 '19 12:05 pawarvijay

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.

Masatoshi avatar Jul 01 '19 10:07 Masatoshi

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

KpjComp avatar Jan 24 '20 23:01 KpjComp