1

I am trying to use an npm module in a component so I installed ember-browserify to be able to import the module, but for some reason it is not being found.

This is how I am trying to import it:

import dropzone from 'npm:dropzone'

this is the error I am getting

Uncaught Error: Could not find module `dropzone` imported from `<Project Name>/components/drop-zone/component`

I don't think it's supposed to be looking for the module there.

I have the npm in the package.json

Do I need to install something else? Is there an extra step I am missing?

EDIT: this is an ember-cli addon

1 Answer 1

1

To use the 'npm:' shortcut you need the awesome ember-browserify addon. Don't forget to star it!

Simply install it into your project via ember install ember-browserify, restart the dev server and it'll work.

Provided that you've had installed the dependency via npm install --save-dev dropzone, of course. ;)

Sign up to request clarification or add additional context in comments.

1 Comment

Install failed. Could not find addon with name: ember-browserify it has to be installed via npm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.