Typescript error “Cannot write file … because it would overwrite input file.”

后端 未结 19 1368
醉梦人生
醉梦人生 2021-02-01 12:04

In my Typescript 2.2.1 project in Visual Studio 2015 Update 3, I am getting hundreds of errors in the error list like:

Cannot write file \'C:/{{my-project

19条回答
  •  一整个雨季
    2021-02-01 12:38

    Most likely, this happens when you try to run one project with two nodes. For this hypothesis, you can test the count of processes on your computer named "node" after run build. What I did to solve the problem:

    Step 1.

    Compare

    node -v
    

    and

    nvm -ls
    

    , the version in use. In terminal set current node version:

    nvm use {neededVersion}
    

    In principle, delete unnecessary versions of the node in nvm (this will help your IDE to automatically determine the normal version of the node).

    Step 2.

    Determine the current node in your IDE. i.e. in WebStorm: Preferencies->Languages & Frameworks -> Node.js and NPM | Typescript: Node interpreter - set needed version.

提交回复
热议问题