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

[BUG] Put failed due to TypeError: Data must be a string or a buffer #51

Open
shentaoy opened this issue Apr 21, 2021 · 0 comments
Open
Labels

Comments

@shentaoy
Copy link

shentaoy commented Apr 21, 2021

What / Why

Running example failed

fetch(
  'https://registry.npmjs.org/cacache/-/cacache-1.0.0.tgz'
).then(data => {
  return cacache.put(cachePath, 'registry.npmjs.org|cacache@1.0.0', data)
}).then(integrity => {
  console.log('integrity hash is', integrity)
})

(node:443) UnhandledPromiseRejectionWarning: TypeError: Data must be a string or a buffer
at Hash.update (crypto.js:99:16)
at algorithms.reduce (/repo/apps/allen/node-test/node_modules/ssri/index.js:322:44)
at Array.reduce ()
at Object.fromData (/repo/apps/allen/node-test/node_modules/ssri/index.js:317:21)
at write (/repo/apps/allen/node-test/node_modules/cacache/lib/content/write.js:31:20)
at Object.putData [as put] (/repo/apps/allen/node-test/node_modules/cacache/put.js:20:10)
at fetch.then.data (/repo/apps/allen/node-test/tests/cacache.js:39:20)
at
at process._tickCallback (internal/process/next_tick.js:189:7)

@shentaoy shentaoy changed the title [BUG] put failed due to TypeError: Data must be a string or a buffer Put failed due to TypeError: Data must be a string or a buffer Apr 21, 2021
@shentaoy shentaoy changed the title Put failed due to TypeError: Data must be a string or a buffer [BUG]Put failed due to TypeError: Data must be a string or a buffer Apr 21, 2021
@darcyclarke darcyclarke changed the title [BUG]Put failed due to TypeError: Data must be a string or a buffer [BUG] Put failed due to TypeError: Data must be a string or a buffer Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants