Error compiling my Typescript file: error TS5011

Asked

Viewed 30 times

0

My code in the file Say.ts:

function say(person) {
    return "Hello" + person;
}

var user = "Gabriel Lemos";

console.log(say(user));

When I tried to compile:

Tsc Say.ts

I had error: path Say.js(1,1): error TS5011: Emit Error: Failed to write to file..

  • Have you tried again? This is a flaw in the environment not in the code.

  • I tried Vscode, tried running Tsc by cmd, powershell. I don’t know how to try to compile

  • 1

    You have permission to save?

  • It was really missing permission, I changed the file path to Downloads and compiled correctly.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.