huserben / TfsExtensions

Extensions for TFS 2015+ such as custom Widgets (require TFS 2017) and Build Tasks
MIT License
45 stars 22 forks source link

Compilation error because extension requires vsts-task-lib #34

Closed Avidres closed 6 years ago

Avidres commented 6 years ago

Hi guys, I have a compilation error when the queue build is started because vsts library is requerid but I have no idea what I should do to resolve it. Please your help with this problem. The error is the next: C:\TFSAgentService\Agent1\tasks\TriggerBuild\2.4.0\index.js:11 const taskLibrary = require("vsts-task-lib/task"); ^^^^^ SyntaxError: Use of const in strict mode. at exports.runInThisContext (vm.js:73:16) at Module._compile (module.js:443:25) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Function.Module.runMain (module.js:501:10) at startup (node.js:129:16) at node.js:814:3

huserben commented 6 years ago

Hi @Avidres

What version of TFS do you use?

Avidres commented 6 years ago

Hi @huserben

I have the version 2015 Upd 2. I installed the library but later I get this a new error: C:\TFSAgentService\Agent1\tasks\TriggerBuild\2.4.0\index.js:21 let useSameBranch; ^^^ SyntaxError: Unexpected strict mode reserved word at exports.runInThisContext (vm.js:73:16) at Module._compile (module.js:443:25) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Function.Module.runMain (module.js:501:10) at startup (node.js:129:16) at node.js:814:3

But I updated node js to 8.7.0 and the extension tries to compile with ecmascript 6

huserben commented 6 years ago

Hi

normally you wouldn't have to install anything to make it work...

You said: But I updated node js to 8.7.0 and the extension tries to compile with ecmascript 6 What do you mean exactly by this? You updated node and it helped or not?

Avidres commented 6 years ago

Hi @huserben

I thought the update might fix this error but the update did not work and still showing the same error as the previous comment. I do not know if the error is caused by the TFS version or there is something that I need to configure

huserben commented 6 years ago

Hi

ok. How exactly did you try to update node? By updating TFS itself or by replacing the node.exe on the agents?

Avidres commented 6 years ago

Only update node with commands to latest version. but not updated TFS. I replaced the node.exe on the agents and this were succesfully. Now I have a problem with authentication, I need compile build with actual user, do you know how to do it?

huserben commented 6 years ago

Hi

ok so the error you shoed in the first post is gone then?

You want to trigger the build for the same user the triggered the first one? There is a checkbox for this under Basic Configuration: "Queue Build for User that triggered original build".

How does your authentication configuration look like? Do you use an OAuth Token?

Avidres commented 6 years ago

Hi @huserben

The first error was solved by replacing the node.exe in the agent as and as you said earlier. I am using the basic authentication and I have activated the box that you mentioned, but it does not work and the extension show me the same error "Authentication with TFS Server failed. Please check your settings".

I use IIS and I do not know if I would need to install basic authentication to solvent this error?

huserben commented 6 years ago

If you want to use basic authentication, then you have to setup TFS to allow "Alternate credentials". Maybe check this out: https://social.msdn.microsoft.com/Forums/vstudio/en-US/96aa6738-6f01-4015-8c59-25215cc84897/enable-alternative-credentials-in-tfs-on-on-premises?forum=tee

Otherwise try using the OAuth method.

huserben commented 6 years ago

Hi @Avidres

did you make any progress in figuring out your problem or can i be more of assitance anyhow?

Avidres commented 6 years ago

Hi @huserben

I activated basic authentication and the problem was solved. Thank you so much for your help.

huserben commented 6 years ago

Hi @Avidres

that's good to hear.

I'll close the issue then.