3

I have two problems:

  • Which definitions should I install? typings search electron returns quite a few results.
  • How do I install them? typings install dt~github-electron --global --save gives me an error:

    Attempted to compile "github-electron" as an external module, but it looks like a global module. You'll need to enable the global option to continue.

3 Answers 3

4

The source needs to be set to dt and it seems to work just fine.

$ typings install github-electron --source dt --global
Sign up to request clarification or add additional context in comments.

3 Comments

Ah, my problem was different – I had run it through npm run typings install... so the --global option was interpreted by npm instead of typings. My original command worked after I added -- before the typings options.
glad you figured it out! :)
I just had the same problem as @AlexGrönholm. I had typings installed as local, meaning that the --global option was interpreted by the npm run typings ... command. Running npm install typings --global and then the typings install ... --global worked as expected.
3

For those who are using TypeScript version 2.0 + you can use npm to get that by executing following line

npm install --save @types/electron

Here is a quick reference from typescript documentation

http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html

if you are using typescript version lower than 2 either you can use typing which other peoples already helped regard that

1 Comment

Yes, this has recently gotten much easier.
1

I had to use a different typing name :

typings install electron/github-electron --source dt --save --global

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.