webpack error in Cannot find module 'less'

后端 未结 8 1348
渐次进展
渐次进展 2021-02-03 21:30

I\'m trying to use less loader in webpack and the issues is - I\'ve installed less loader locally, but when I try to compile everything using webpack command in bask, it prints

8条回答
  •  离开以前
    2021-02-03 22:07

    It sounds like you haven't installed the less-loader into your node_modules. Installing it would fix this.

    npm install less-loader --save-dev
    

    Edit: Also you will get this error when you haven't installed the css-loader and style-loader that you are chaining less-loader to.

    Anyone who comes across this can plus on the issue I submitted for the bad message. "Error in Cannot find module 'less'" when missing loaders chained after less. Revise error message.

提交回复
热议问题