@types/node installed typescript version not able find module“ child_process”

前端 未结 1 1684
离开以前
离开以前 2021-01-02 15:13

I found typescript version for node unfortunately it\'s not able find "child_process" module from the node packages.

Exactly the error mess

1条回答
  •  悲&欢浪女
    2021-01-02 15:21

    Maybe is the path:

    "typeRoots": [
          "../node_modules/@types"
        ]
    

    Usually you have your tsconfig in a src.

    Update:

    My original answer makes no sense, because you have this "baseUrl": "src".

    As instead, I believe it could be a Webpack issue.

    Try adding this to your webpack.config file:

    target: 'node'
    

    Update 2:

    Workaround: Add the following to your config file:

    node: {
          child_process: 'empty'
    }
    

    0 讨论(0)
提交回复
热议问题