Explosion-Scratch / claude-unofficial-api

Unofficial API for Claude-2 via Claude Web (Also CLI)
https://npmjs.com/package/claude-ai
The Unlicense
729 stars 78 forks source link

josn.map is not a function with the CLI #59

Open kqvanity opened 23 hours ago

kqvanity commented 23 hours ago

running claude --key raises the following error

(node:2610641) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
TypeError: json.map is not a function
    at Claude.getConversations (file:///home/keinvanity/.local/lib/node_modules/claude-cli/node_modules/claude-ai/index.js:298:21)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Claude.init (file:///home/keinvanity/.local/lib/node_modules/claude-cli/node_modules/claud
e-ai/index.js:174:37)
    at async main (file:///home/keinvanity/.local/lib/node_modules/claude-cli/index.js:124:5)

and running via the library raises another error

file:///home/keinvanity/Downloads/claude-misc/Explosion-Scratch-claude-unofficial-api/node_modules/claude-ai/index.js:171
            throw new Error(JSON.stringify(organizations, null, 2))
                  ^

Error: {
  "error": {
    "message": "We are unable to serve your request",
    "type": "permission_error"
  }
}
    at Claude.init (file:///home/keinvanity/Downloads/claude-misc/Explosion-Scratch-claude-unofficial-api/node_modules/claude-ai/index.js:171:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async file:///home/keinvanity/Downloads/claude-misc/Explosion-Scratch-claude-unofficial-api/main.js:7:1

Node.js v22.9.0