Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tfx build tasks upload gives error no task.json in specified directory[49m At C:\Users\pkuijper\AppData\Roaming\npm\tfx.ps1:24 char:5 #459

Open
pkuijper opened this issue Jun 28, 2024 · 1 comment

Comments

@pkuijper
Copy link

node version 22.3.0
npm version 10.8.1

PS C:\temp\SampleTask> tfx build tasks upload --task-path C:\temp\SampleTask
[37m[90mTFS Cross Platform Command Line Interface v0.17.0[37m[39m
[37m[90mCopyright Microsoft Corporation[37m[39m
node.exe : [41merror: Error: no task.json in specified directory[49m
At C:\Users\pkuijper\AppData\Roaming\npm\tfx.ps1:26 char:5
+     & "node$exe"  "$basedir/node_modules/tfx-cli/_build/tfx-cli.js" $ ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: ([41merror: Err... directory[49m:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

File structure:

--- SampleTask
    |--- images
          |--- extension-icon.png
    |--- sampletask
          |--- ps_modules
                |--- ....
          |--- sample.ps1
          |--- task.json
    |--- vss-extension.json
    |--- test.sample-build-release-task-0.0.1.vsix

I tested the task.json content on https://jsonlint.com/, and it is valid.
if i open file "test.sample-build-release-task-0.0.1.vsix" as a zip it contains the task.json file.

i followed steps
https://learn.microsoft.com/en-us/azure/devops/extend/develop/add-build-task?view=azure-devops
and the steps in
https://4bes.nl/2021/02/21/create-a-custom-azure-devops-powershell-task/

I login to our tfs server successfully with the command
"tfx login --auth-type pat --token **************************** --service-url https://mytfsserver/mycollections"
but uploading the task fails with command
"tfx build tasks upload --task-path C:\temp\SampleTask"

@DenisRumyantsev
Copy link

Hi @pkuijper I cannot reproduce your issue using node version 22.3.0, npm version 10.8.1, and tfx version 0.17.0 (currently the latest one). Is it possible that tfx cannot read the task.json file due to lack of access rights? Can you try to run it as administrator?

@DenisRumyantsev DenisRumyantsev self-assigned this Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants