# Error on fetch using CMS CLI

**URL:** <https://community.hubspot.com/t/error-on-fetch-using-cms-cli/28877>\
**Category:** CMS Development\
**Tags:** design-manager\
**Created:** [December 8, 2020, 10:13am UTC](https://community.hubspot.com/t/error-on-fetch-using-cms-cli/28877 "2020-12-08T10:13:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexfalexf](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/alexfalexf/32/102498_2.png) [@alexfalexf](https://community.hubspot.com/u/alexfalexf)\
**Post date:** [December 8, 2020, 10:13am UTC](https://community.hubspot.com/t/error-on-fetch-using-cms-cli/28877/1 "2020-12-08T10:13:27Z")

</div>

Hi there,

I’m looking to use the CLI to upload and mantain a large number of image files in our Hubspot filemanager. I’ve installed node.js and the HubSpot tools as instructed here: [Install the HubSpot CLI - HubSpot docs](https://developers.hubspot.com/docs/cms/guides/getting-started-with-local-development)

When I attempt to do a fetch I get an error:

`hs filemanager fetch --portal=myName "Images"`

The result is the first child folder of Images is fetched, as is its first child, and so on for a total of 4 child folders (only fetching the first of each) as is the first file in that folder, but after that nothing. Here’s my error:

```lia-code-sample
PS C:\myLocalDir> hs fetch "Images"
Fetched "Images" from portal ######### from the Desing Manager successfully
Skipped existing "C:\myLocalDir\Images"
[SUCCESS] Completed fetch of folder "Images" to "C:\myLocalDir" from the Design Manager
PS C:\myLocalDir> hs fetch "Images"
Fetched "Images" from portal ######### from the Desing Manager successfully
Wrote folder "C:\myLocalDir\Images"
[SUCCESS] Completed fetch of folder "Images" to "C:\myLocalDir" from the Design Manager
PS C:\myLocalDir> hs fetch --portal=myName "Images"
Fetched "Images" from portal ######### from the Desing Manager successfully
Wrote folder "C:\myLocalDir\Images"
[SUCCESS] Completed fetch of folder "Images" to "C:\myLocalDir" from the Design Manager
PS C:\myLocalDir> hs filemanager fetch --portal=myName "Images"
Fetching folder from "Images" to "C:\myLocalDir\Images" in the File Manager of portal #########
internal/fs/utils.js:622
throw new ERR_INVALID_ARG_TYPE(propName, ['string', 'Buffer', 'URL'], path);
^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received an instance of WriteStream
at open (fs.js:443:10)
at go$open (C:\Users\me\AppData\Roaming\npm\node_modules\@hubspot\cms-cli\node_modules\graceful-fs\graceful-fs.js:328:14)
at open (C:\Users\me\AppData\Roaming\npm\node_modules\@hubspot\cms-cli\node_modules\graceful-fs\graceful-fs.js:325:12)
at WriteStream$open [as open] (C:\Users\me\AppData\Roaming\npm\node_modules\@hubspot\cms-cli\node_modules\graceful-fs\graceful-fs.js:300:5)
at _openWriteFs (internal/fs/streams.js:366:12)
at WriteStream (internal/fs/streams.js:343:5)
at new WriteStream (C:\Users\me\AppData\Roaming\npm\node_modules\@hubspot\cms-cli\node_modules\graceful-fs\graceful-fs.js:293:29)
at Object.createWriteStream (C:\Users\me\AppData\Roaming\npm\node_modules\@hubspot\cms-cli\node_modules\graceful-fs\graceful-fs.js:316:12)
at Request.<anonymous> (C:\Users\me\AppData\Roaming\npm\node_modules\@hubspot\cms-cli\node_modules\@hubspot\cms-lib\http.js:153:34)
at Request.emit (events.js:315:20) {
code: 'ERR_INVALID_ARG_TYPE'
}

```

Any pointers much appreciated. Thanks

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [December 9, 2020, 6:29pm UTC](https://community.hubspot.com/t/error-on-fetch-using-cms-cli/28877/2 "2020-12-09T18:29:26Z")

</div>

Hey @alexfalexf , are you still having issues here?

---

<div class="post-metadata">

**Author:** ![alexfalexf](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/alexfalexf/32/102498_2.png) [@alexfalexf](https://community.hubspot.com/u/alexfalexf)\
**Post date:** [December 15, 2020, 4:40pm UTC](https://community.hubspot.com/t/error-on-fetch-using-cms-cli/28877/3 "2020-12-15T16:40:57Z")

</div>

Hi Dennis - sorry - I somehow missed your reply. Yes - I’ve got no further on it…

I’m wondering if it’s a problem with the node.js installation perhaps?

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [December 15, 2020, 5:53pm UTC](https://community.hubspot.com/t/error-on-fetch-using-cms-cli/28877/4 "2020-12-15T17:53:19Z")

</div>

No worries @alexfalexf

Are you able to test with another portal? A sandbox account maybe?

Could also run **npm install -g @_hubspot_/cms-_cli_@latest** to make sure you are up to date.

---

<div class="post-metadata">

**Author:** ![alexfalexf](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/alexfalexf/32/102498_2.png) [@alexfalexf](https://community.hubspot.com/u/alexfalexf)\
**Post date:** [December 18, 2020, 1:03pm UTC](https://community.hubspot.com/t/error-on-fetch-using-cms-cli/28877/5 "2020-12-18T13:03:12Z")

</div>

Thanks @dennisedson ! Running the update fixed it.
