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
I got the same issue. In my case, it was the result of the option: allowJs: true
.
So I basically had to remove that line to get rid of the errors. I do not see it in your code, but perhaps it helps you here.
Good luck!
this config works for me
"allowJs": true
Adding 'dist' to the excluded directories in tsconfig.json worked for me:
{
"exclude": ["node_modules", "dist"]
}
Probably the root of the problem is 2 files generating the same module. So if one have two files in the same folder with the same name but with different extensions leads to this error.
eg:
\index.ts
\index.tsx
Solution is changing one of these files names to something else.
I had this issue too. In my case, I restored the original version of file \tools\JsEngine\typescriptServices.js
and it solved.
I found that typescriptServices.js was changed by Visual Studio, because of the end of the line (CRLF or CR)
, and after that VS
cannot run it in a correct way.
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.