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

Module build failed: Error: Cannot find module 'less' #39

Open
weituotian opened this issue Nov 12, 2017 · 5 comments
Open

Module build failed: Error: Cannot find module 'less' #39

weituotian opened this issue Nov 12, 2017 · 5 comments

Comments

@weituotian
Copy link

in ./node_modules/.0.26.4@css-loader!./node_modules/.2.2.3@less-loader!./node_modules/.0.0.5-beta.2@font-awesome-webpack/font-awesome-styles.loader.js!./node_modules/.0.0.5-beta.2@font-awesome-webpack/font-awesome.config.js
Module build failed: Error: Cannot find module 'less'
 @ ./node_modules/.0.13.2@style-loader!./node_modules/.0.26.4@css-loader!./node_modules/.2.2.3@less-loader!./node_modules/.0.0.5-beta.2@font-awesome-webpack/font-awesome-styles.loader.js!./node_modules/.0.0.5-beta.2@font-awesome-webpack/font-awesome.config.js 4:14-145 13:2-17:4 14:20-151
 @ ./node_modules/.0.0.5-beta.2@font-awesome-webpack/index.js
 @ ./node_modules/.7.1.2@babel-loader/lib!./node_modules/.13.5.0@vue-loader/lib/selector.js?type=script&index=0&bustCache!./src/components/Personal.vue
 @ ./src/components/Personal.vue
 @ ./src/router/index.js
 @ ./src/main.js
 @ multi ./build/dev-client ./src/main.js
@Nogbit
Copy link

Nogbit commented Nov 13, 2017

I had the same problem and resolved it by installing the following packages

less
url-loader
file-loader

@weituotian
Copy link
Author

@Nogbit thanks for your advice! i will try it!

@JamesTheHacker
Copy link

JamesTheHacker commented Nov 13, 2017

Same problem. Shouldn't the less module be a dependancy as it doesn't seem to work without it?

@maximerety
Copy link

@JamesJefferyUK

I don't think so as less isn't a direct dependency of font-awesome-webpack, but a peer dependency of less-loader(see package.json), which is itself a dependency of font-awesome-webpack (see package.json).

So it's up to the less-loader package to make it a normal dependency if needed, but they decided not to (see webpack-contrib/less-loader#62 (comment)).

More on peer dependencies in this good article: https://lexi-lambda.github.io/blog/2016/08/24/understanding-the-npm-dependency-model/

@0ENZO
Copy link

0ENZO commented Jun 4, 2021

I had the same problem and resolved it by installing the following packages

less
url-loader
file-loader

I know the topic is kinda old but I had a recent problem with less-loader and webpack and this is exactly what I needed ! Thank you

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

5 participants