Skip to content

Module not found: Error: Can't resolve 'cluster' #1050

@AsteriskZuo

Description

@AsteriskZuo

ref: #920

I confirm the above question, but it still exists.
I use Typescript in VUE:
yarn add log4js // add depend plugin
yarn serve // build demo project
tip:

 WARNING  Compiled with 2 warnings                                                                                                                                                                                              2:15:09 PM  
 warning  in ./node_modules/log4js/lib/appenders/index.js  
Critical dependency: the request of a dependency is an expression  
 warning  in ./node_modules/log4js/lib/clustering.js  
Module not found: Error: Can't resolve 'cluster' in '/.../node_modules/log4js/lib'  

I try to modify the clustering.js source code.

//try {  
  //cluster = require("cluster"); //eslint-disable-line  
//} catch (e) {  
  debug("cluster module not present");  
  disabled = true;  
//}  

So the compile will not report an error. But there are other problems.
Cluster is the product of 2011, can you not use it? It is 2020, you are too lazy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions