alenny / angular2-adal

MIT License
21 stars 66 forks source link

error in building angular2-adal #8

Open liushuping opened 8 years ago

liushuping commented 8 years ago

I cloned the whole repo, and had run the commands

npm install
gulp

but get below errors:

src/services/adal.service.ts(4,26): error TS2307: Cannot find module 'adal'.
src/services/adal.service.ts(10,26): error TS2503: Cannot find namespace 'adal'.
src/services/adal.service.ts(18,32): error TS2503: Cannot find namespace 'adal'.
src/services/adal.service.ts(40,26): error TS2503: Cannot find namespace 'adal'.
src/services/adal.service.ts(89,34): error TS2503: Cannot find namespace 'adal'.
src/services/adal.service.ts(90,58): error TS2503: Cannot find namespace 'adal'.
src/services/adal.service.ts(91,69): error TS2503: Cannot find namespace 'adal'.
jvanderbiest commented 8 years ago

Same issue here doing a clean install on a windows box.

negberts commented 8 years ago

I fixed it by adding "adal": "github:DefinitelyTyped/DefinitelyTyped/adal-angular/adal.d.ts#53347571e6f44ed9a961b569bb81893fde4789c1" to typings.json

liushuping commented 8 years ago

@negberts , could you please submit a pull request of your fix to help us?

jvanderbiest commented 8 years ago

@negberts Strange, I tried that before but then I encountered the following errors:

src\services\adal.service.ts(34,36): error TS2339: Property 'inject' does not exist on type '{ AuthenticationContext: AuthenticationContextStatic; Logging: Logging; }'. src\services\adal.service.ts(65,62): error TS2339: Property 'REQUEST_TYPE' does not exist on type 'AuthenticationContext'. src\services\adal.service.ts(67,69): error TS2339: Property 'REQUEST_TYPE' does not exist on type 'AuthenticationContext'. typings\index.d.ts(1,1): error TS6053: File 'c:/repos/adal/angular_pull/angular2 -adal/typings/globals/adal-angular/index.d.ts' not found.

negberts commented 8 years ago

Well, this fix did it for me in the example... (https://github.com/alenny/angular2-adal-example) As I try it in this solution I get the errors

src\services\adal.service.ts(34,36): error TS2339: Property 'inject' does not exist on type '{ AuthenticationContext: AuthenticationContextStatic; Logging: Logging; }'. src\services\adal.service.ts(65,62): error TS2339: Property 'REQUEST_TYPE' does not exist on type 'AuthenticationContext'. src\services\adal.service.ts(67,69): error TS2339: Property 'REQUEST_TYPE' does not exist on type 'AuthenticationContext'.

Which seem correct because they don't exist on the interface at https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/adal-angular/adal.d.ts

Maybe a systemjs.config should be added like in the example? (I am also still figuring out how to do this whole Angular2 thing :))

negberts commented 8 years ago

Well, I am not allowed to publish my feature branch, but the error can be fixed by adding your own adal\index.d.ts to the src branch. I took the index.d.ts from the angular2-adal-example node_modules\angular2-adal\typings\adal path

index.d.txt

jvanderbiest commented 8 years ago

no worries, I already created a pull request over there... https://github.com/alenny/angular2-adal-example/pull/3

liushuping commented 8 years ago

@jvanderbiest why in example repo rather than this source repo?

negberts commented 8 years ago

@liushuping well, we want the example to work as well don't we? :)

This source repo can be fixed by adding the file from my previous comment, but as I mentioned, authorization prohibites me from creating a pull request in this repo

corfor commented 8 years ago

If you use Typings: typings install -GD github:DefinitelyTyped/DefinitelyTyped/adal-angular/adal.d.ts#53347571e6f44ed9a961b569bb81893fde4789c1

galvanu commented 7 years ago

I have the same issue while trying to integrate it in angular-cli project. do you have solution for this scenario where typings is not part of the project and instead using @type of npm?

MikeLallemont commented 7 years ago

I am having the same issue while trying to use @types/adal. It is only an issue on a Window machine though, my Mac works fine. Anybody got ideas?

galvanu commented 7 years ago

Do you have typings installed globally both on the windows and mac machines?

And I'm getting the following issue:

ERROR in ./~/ng2-adal/services/adal.service.js Module not found: Error: Can't resolve 'adal' in '/Users/user/Workspace/project/node_modules/ng2-adal/services' @ ./~/ng2-adal/services/adal.service.js 21:14-29 @ ./~/ng2-adal/services.js @ ./~/ng2-adal/core.js @ ./src/app/app.module.ts @ ./src/app/index.ts @ ./src/main.ts @ multi main

Do you have any idea how can I solve this?