Install Typings require for Ionic2 application

前端 未结 2 1523
野性不改
野性不改 2021-01-21 16:05

So I am working on Ionice2 project (still new at this .. almost a week), and I am trying to follow the tutorial below to use PouchDB for LocalStorage.

Tutorial: http://g

相关标签:
2条回答
  • 2021-01-21 16:26

    Typings has been updated recently. Update to latest version of typings first.

    To install require.d.ts file use typings install dt~require --save --global

    Refer https://github.com/typings/typings for further details

    0 讨论(0)
  • 2021-01-21 16:42

    Not a direct answer to the question, but I think it should be mentioned. The Typescript team has recently added a built in way of managing definition files. They've built the @types system on top of npm. The whole goal is that you don't need to use two separate package managers and you don't need to use multiple config files (previously package.json, typings.json, etc). Now, it's all managed within package.json.

    If you were to install lodash, for example. You just:

    npm install --save lodash
    npm install --save @types/lodash
    

    And you're good to go. Both are managed in your package.json and you won't need to use any /// <reference-path path="blah-blah-blah">.

    Or, as Microsoft calls it, "The Future of Declaration Files".

    0 讨论(0)
提交回复
热议问题