webpack error in Cannot find module 'less'

后端 未结 8 1492
渐次进展
渐次进展 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:04

    I had the same issue. ERROR in Cannot find module 'less'

    ├── UNMET PEER DEPENDENCY file-loader@*
    ├── UNMET PEER DEPENDENCY less@^2.3.1
    ├── webpack@1.13.2 
    └── webpack-dev-server@1.16.2 
    npm WARN EPEERINVALID less-loader@2.2.3 requires a peer of less@^2.3.1 
    but none was installed.
    npm WARN EPEERINVALID url-loader@0.5.7 requires a peer of file-loader@* 
    but none was installed.
    

    I tried as follows:

    npm install --save-dev less
    npm install --save-dev file-loader
    

    Then it solved the issues.

提交回复
热议问题