W
W
Wasya UK2020-02-15 19:19:04
npm
Wasya UK, 2020-02-15 19:19:04

How to properly install mapbox-gl-directions?

Loaded the module npm i --save @mapbox/mapbox-gl-directionsEverything is OK. But when importing, I get an error stating that I need to load another module declaration. I tried all the options, and none of them loaded. How do you connect this module?

import MapboxDirections from '@mapbox/mapbox-gl-directions/dist/mapbox-gl-directions'

npm i --save @types/mapbox__mapbox-gl-directions                                                   npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@types%2fmapbox__mapbox-gl-directions - Not found

npm i --save @types/@mapbox-gl-directions                                                          npm ERR! code EINVALIDPACKAGENAME
npm ERR! Invalid package name "@types/": name can only contain URL-friendly characters

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2020-02-15
@dmc1989

And it is not, this declaration of yours! *creepy laugh*
The creators of this module did not bother to make a declaration, those declarations in @ types are supported by the community on an open basis (they are here ), and there too (yet?) no Samaritan has added anything.
So you just have to make the declaration yourself. Help you with this (with some luck) dts-gen .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question