Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package.json requires "main" for babel #35

Open
udalrich opened this issue Feb 15, 2017 · 2 comments
Open

Package.json requires "main" for babel #35

udalrich opened this issue Feb 15, 2017 · 2 comments

Comments

@udalrich
Copy link

udalrich commented Feb 15, 2017

I am trying to use this with babel and ES6 notation. I have done npm install --save leaflet.coordinates and see the directory in my node_modules. When I try to do

import 'leaflet.coordinates'

from my script, babel gives me an error:

Error: Cannot find module 'leaflet.coordinates' from '/path/to/main.jsx'

If I copy Leaflet.Coordinates-0.1.5.src.js to my directory an do

import './leaflet.coordinates.jsx'

instead, then I am able to run babel and the component shows up on my map.

Comparing the package.json for leaflet and leaflet.coordinates, I see that leaflet has an entry for main which is missing. In fact, adding this line

"main": "dist/Leaflet.Coordinates-0.1.5.src.js",

to package.json let babel succeed.

@hlovdal
Copy link

hlovdal commented Feb 27, 2018

This is solved by pull request 30.

@cyycyy614
Copy link

I have done " npm install --save leaflet.coordinates "
import 'leaflet.coordinates
then npm run dev ,but it is also gives me an error :
To install it, you can run: npm install --save leaflet.coordinates
why? i don't know how is it the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants