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

Issue with Emitter #20

Closed
LeCoupa opened this issue Jun 27, 2017 · 6 comments
Closed

Issue with Emitter #20

LeCoupa opened this issue Jun 27, 2017 · 6 comments

Comments

@LeCoupa
Copy link

LeCoupa commented Jun 27, 2017

When I install color-picker with npm, the following error occurs when I try to import the package:

Module build failed: Error: ENOENT: no such file or directory, open '.../node_modules/emitter/dist/emit

When I install the package with npm install --save emitter, the error seems to disappear in the terminal but a new one occurs in Chrome:

Uncaught (in promise) TypeError: Emitter is not a function

If you inspect the file index.js in node_modules, this seems to come from:

/**
 * Mixin Emitter.
 */

Emitter(ColorPicker.prototype);

For the first issue, I suggest you add this package as a module dependency in package.json. For the second one, I don't have any answer.

@taufik-nurrohman
Copy link
Owner

The module name is simply CP, not ColorPicker. Are there some automation on replacing slug-case into PascalCase behind the proccess?

@LeCoupa
Copy link
Author

LeCoupa commented Jun 28, 2017

I understand now... How can I install color-picker with NPM? Did you register the package? Because you named it color-picker in package.json but there is already a package registered with that name.

https://www.npmjs.com/package/color-picker

So when I run npm install --save color-picker, it does not install your package but this one. That's why it did not work. :)

https://docs.npmjs.com/getting-started/publishing-npm-packages

@taufik-nurrohman
Copy link
Owner

I didn’t use package manager by myself, so my experience with it is very poor. I created the package.json file based on another JavaScript project. It should have been registered but unfortunately it doesn’t.

@LeCoupa
Copy link
Author

LeCoupa commented Jun 28, 2017

Are you going to register it? Do you need help?

@taufik-nurrohman
Copy link
Owner

I’d love to. But for the next 3 months probably I will be out from my computer for a while. I don’t want to make everybody waiting so I will try to learn it by myself if I have a spare time. Thanks.

@taufik-nurrohman
Copy link
Owner

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

2 participants