Install Typings require for Ionic2 application
Asked Answered
I

2

2

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://gonehybrid.com/how-to-use-pouchdb-sqlite-for-local-storage-in-ionic-2/

One of the requirements is to install require using the following command

typings install require --ambient --save

Whenever I try this command, I get the error

Unable to find "require" ("npm") in the registry. 
Did you want to try searching another source? 
Also, if you want contribute these typings, please help us: https://github.com/typings/registry

Noting that I already installed Typings using the command below, what are the possible causes for this issue ?

npm install typings --global
Impostume answered 25/5, 2016 at 17:43 Comment(3)
I successfully followed the same tutorial, but I used this command to install typings: npm install -g typings Not sure if that is functionally identical to what you used.Expenditure
@wilburrr90 I tried that as well but same resultImpostume
@wilburrr90 which operating system are you using?Impostume
T
3

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

Twaddle answered 26/5, 2016 at 6:37 Comment(0)
L
1

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".

Landowska answered 11/1, 2017 at 4:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.