Skip to content

error TS2304: Cannot find name 'XMLHttpRequest' #2

@WalterLeinert

Description

@WalterLeinert

Hi Romain,

I'm trying do play around with your library. But installation fails.

Environment:

  • Windows10, x64
  • cygwin, vscode
  • node v7.0.0, npm: 3.10.9
  • typescript 2.0.3

when i run the command:
npm install --save ts-express-decorators

I get the following errors:

(regards, Walter)
...
ts-express-decorators@1.0.0 postinstall D:\Entwicklung\angular2\angular-cli\christian-lehmeier\ts-express-decorators-test\node_modules\ts-express-decorators

npm run build

ts-express-decorators@1.0.0 build D:\Entwicklung\angular2\angular-cli\christian-lehmeier\ts-express-decorators-test\node_modules\ts-express-decorators
npm run tsc:es5 && npm run tsc:es6

ts-express-decorators@1.0.0 tsc:es5 D:\Entwicklung\angular2\angular-cli\christian-lehmeier\ts-express-decorators-test\node_modules\ts-express-decorators
tsc --project tsconfig.json

../@types/superagent/index.d.ts(79,12): error TS2304: Cannot find name 'XMLHttpRequest'.

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\Walter\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "tsc:es5"
npm ERR! node v7.0.0
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! ts-express-decorators@1.0.0 tsc:es5: tsc --project tsconfig.json
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the ts-express-decorators@1.0.0 tsc:es5 script 'tsc --project tsconfig.json'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ts-express-decorators package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! tsc --project tsconfig.json
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ts-express-decorators
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ts-express-decorators
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR! D:\Entwicklung\angular2\angular-cli\christian-lehmeier\ts-express-decorators-test\node_modules\ts-express-decorators\npm-debug.log

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\Walter\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "build"
npm ERR! node v7.0.0
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! ts-express-decorators@1.0.0 build: npm run tsc:es5 && npm run tsc:es6
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ts-express-decorators@1.0.0 build script 'npm run tsc:es5 && npm run tsc:es6'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ts-express-decorators package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run tsc:es5 && npm run tsc:es6
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ts-express-decorators
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ts-express-decorators
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR! D:\Entwicklung\angular2\angular-cli\christian-lehmeier\ts-express-decorators-test\node_modules\ts-express-decorators\npm-debug.log
npm WARN ts-express-decorators@1.0.0 requires a peer of express@^4 but none was installed.
npm WARN ts-express-decorators-test@1.0.0 No description
npm WARN ts-express-decorators-test@1.0.0 No repository field.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\Walter\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "--save" "ts-express-decorators"
npm ERR! node v7.0.0
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE

npm ERR! ts-express-decorators@1.0.0 postinstall: npm run build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ts-express-decorators@1.0.0 postinstall script 'npm run build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ts-express-decorators package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ts-express-decorators
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ts-express-decorators
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! D:\Entwicklung\angular2\angular-cli\christian-lehmeier\ts-express-decorators-test\npm-debug.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions