Skip to content

Cannot find module log4js with TypeScript #1360

@2277509846

Description

@2277509846

Use the import method to import log4js, execute the tsc command, and the error "Cannot find module 'log4js'" will be reported, but the compiled js file can run normally.

error TS2792: Cannot find module 'log4js'
index.ts:
`import log4js from "log4js";
// log4js.configure({
// appenders: { cheese: { type: "file", filename: "cheese.log" } },
// categories: { default: { appenders: ["cheese"], level: "error" } }
// });

const logger = log4js.getLogger();
logger.level = "debug";
logger.debug("Some debug messages");`
image

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