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

TypeError: fs.copyFile is not a function #18

Open
ScottHutchinson opened this issue Jul 22, 2020 · 5 comments
Open

TypeError: fs.copyFile is not a function #18

ScottHutchinson opened this issue Jul 22, 2020 · 5 comments

Comments

@ScottHutchinson
Copy link

ScottHutchinson commented Jul 22, 2020

TFS 2018 on Windows Server with node.js Latest LTS Version: 12.18.3 (includes npm 6.14.6):

2020-07-22T23:12:09.8281274Z task display name: cloc --windows .
2020-07-22T23:12:09.8286442Z working folder: C:\Msft_test\AgentSmith_work\1\s
2020-07-22T23:12:09.8344899Z cloc-cli download url: file://C:/cloc/cloc-1.86.exe
2020-07-22T23:12:09.8345511Z arguments: --windows .
2020-07-22T23:12:09.8345591Z Downloading cloc.exe from:
2020-07-22T23:12:09.8345752Z Url {
2020-07-22T23:12:09.8345822Z protocol: 'file:',
2020-07-22T23:12:09.8345890Z slashes: true,
2020-07-22T23:12:09.8345973Z auth: null,
2020-07-22T23:12:09.8346037Z host: 'c',
2020-07-22T23:12:09.8346101Z port: null,
2020-07-22T23:12:09.8346166Z hostname: 'c',
2020-07-22T23:12:09.8346493Z hash: null,
2020-07-22T23:12:09.8346560Z search: null,
2020-07-22T23:12:09.8346624Z query: null,
2020-07-22T23:12:09.8346711Z pathname: '/cloc/cloc-1.86.exe',
2020-07-22T23:12:09.8346785Z path: '/cloc/cloc-1.86.exe',
2020-07-22T23:12:09.8346858Z href: 'file://c/cloc/cloc-1.86.exe' }
2020-07-22T23:12:09.8346939Z Copying file from '//c/cloc/cloc-1.86.exe'
2020-07-22T23:12:09.8383559Z ##[error]cloc --windows . failed
2020-07-22T23:12:09.8403635Z ##[error]TypeError: fs.copyFile is not a function
2020-07-22T23:12:09.8403837Z TypeError: fs.copyFile is not a function
2020-07-22T23:12:09.8403946Z at Object.downloadClocCli [as default] (C:\Msft_test\AgentSmith_work_tasks\cloc_7b598338-cf0d-4c3f-acc2-4967b6202533\1.2.1\clocCliDownloader.js:16:20)
2020-07-22T23:12:09.8404106Z at C:\Msft_test\AgentSmith_work_tasks\cloc_7b598338-cf0d-4c3f-acc2-4967b6202533\1.2.1\index.js:33:40
2020-07-22T23:12:09.8404193Z at next (native)
2020-07-22T23:12:09.8404295Z at C:\Msft_test\AgentSmith_work_tasks\cloc_7b598338-cf0d-4c3f-acc2-4967b6202533\1.2.1\index.js:7:71
2020-07-22T23:12:09.8404401Z at __awaiter (C:\Msft_test\AgentSmith_work_tasks\cloc_7b598338-cf0d-4c3f-acc2-4967b6202533\1.2.1\index.js:3:12)
2020-07-22T23:12:09.8404530Z at run (C:\Msft_test\AgentSmith_work_tasks\cloc_7b598338-cf0d-4c3f-acc2-4967b6202533\1.2.1\index.js:15:12)
2020-07-22T23:12:09.8404642Z at Object. (C:\Msft_test\AgentSmith_work_tasks\cloc_7b598338-cf0d-4c3f-acc2-4967b6202533\1.2.1\index.js:47:1)
2020-07-22T23:12:09.8404751Z at Module._compile (module.js:570:32)
2020-07-22T23:12:09.8404831Z at Object.Module._extensions..js (module.js:579:10)
2020-07-22T23:12:09.8404918Z at Module.load (module.js:487:32)

@dparvin
Copy link

dparvin commented Apr 4, 2021

It seems to download the file from the webserver OK, but when you have the file local, and specify it in the task as you described, the task produces an error like this one. The other problem I have had is when I download the file from the server every time, I sometimes get the agent to crash and restart. I believe it has to do with Windows Security and the EXE getting blocked as it is getting downloaded. When you then try to execute the counting, the agent crashes.

@ScottHutchinson
Copy link
Author

"A build task for Visual Studio Team Services (VSTS) made with ♥ by
dealogic" but maintained by nobody, apparently.

@jkanczler
Copy link
Member

Unfortunately, it's true. I don't have time anymore to maintain this project. I left Dealogic almost two years ago when Dealogic bought by ION Group. Because of the acquisition, I believe Dealogic is not using this tool anymore.

@dparvin
Copy link

dparvin commented Apr 7, 2021

Is it possible that the problem is we don't have the right version of node installed on the machine where the agent is installed to run the task?

@ScottHutchinson
Copy link
Author

The node dependency seems to be completely undocumented. So who knows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants