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

Cannot resolve module 'angular-multi-select' #95

Closed
Hellowor1d opened this issue Apr 23, 2016 · 3 comments
Closed

Cannot resolve module 'angular-multi-select' #95

Hellowor1d opened this issue Apr 23, 2016 · 3 comments

Comments

@Hellowor1d
Copy link

There was a problem confused me for a long time,when I use "npm install angular-multi-select",It's Ok,it lies in the node_modules folders sliently, but when I use webpack(1.13.0) to require("angular-multi-select") in ./app/jobModule/indexController.js,the problem came:

ERROR in ./app/jobModule/indexController.js
Module not found: Error: Cannot resolve module 'angular-multi-select' in D:\work\newbeehive\hive\src\app\jobModule
@ ./app/jobModule/indexController.js 17:4-35

and I don't konw what the wrong was,beacuse the other directives worked well here with the method I took. pls.

@alexandernst
Copy link
Owner

I have no idea how Webpack works or what is required for this library to be compatible with Webpack. I'll research when I have some spare time.

@TamaBaka
Copy link

TamaBaka commented Jul 8, 2016

I think I had this problem too considering my source code says 'angular-multi-select/dist/prod/angular-multi-select' instead of 'angular-multi-select'.

So let me explain the trick that I used: inside of the node_module folder you'll find an angular-multi-select folder if it's installed correctly. Normally, that would be enough. But I don't know which configuration file makes it work. However, I found a different solution after playing around a bit. While messing around, I discovered that webpack was perfectly happy with calling that folder in node_module a base folder! So with a bit of folder browsing, I figured out the path to the distributable starting from angular-multi-select...and voila:

require('angular-multi-select/dist/prod/angular-multi-select')

node_modules
    |
    |
    angular-multi-select
        |
        |
        dist
            |
            |
            prod
                |
                |
                **angular-multi-select.js**
                angular-multi-select.min.js

The above should work.

This is pointing at the unminimized source code. You can replace it with 'angular-multi-select/dist/prod/angular-multi-select.min' if you want to include the uglified version. I figure since webpack can be configured to uglify after the fact, it's perfectly fine using the uncompressed version.

@Hellowor1d
Copy link
Author

@TamaBaka 👍 Thank you very much for the long and interesting reply 😜

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

No branches or pull requests

3 participants