Module not found when initializing Chat API
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 28/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript, node.js
调研方向
首先,使用 @googleapis/chat ^21.0.0 版本运行 npm run start 复现故障,并检查 gaxios 堆栈位置以及已安装的 https-proxy-agent 软件包元数据。将依赖项状态与报告中可正常工作的 googleapis 17.0.1 进行比较;完成的标准是确定一种可复现的解析结果,并确认 Chat API 初始化成功。
由索引模型根据 Issue 内容生成。
描述
Environment details
- OS: Windows 11
- Node.js version: 16.0.0
- npm version: 7.4.0
googleapisversion: ^21.0.0
Steps to reproduce
I'm getting the following error when trying to use the chat API. When I run npm run start I get:
Error: Cannot find module 'C:\Users\Martin Carrasco\Desktop\BurnoutZero\boz-google-chat-app\node_modules\https-proxy-agent\dist\index.js'. Please verify that the package.json has a valid "main" entry
at Module._findPath (node:internal/modules/cjs/loader:720:18)
at Module._resolveFilename (node:internal/modules/cjs/loader:1135:27)
at Module._load (node:internal/modules/cjs/loader:990:27)
at Module.require (node:internal/modules/cjs/loader:1237:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (C:\Users\Martin Carrasco\Desktop\BurnoutZero\boz-google-chat-app\node_modules\gaxios\build\src\gaxios.js:27:29)
at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
at Module.load (node:internal/modules/cjs/loader:1212:32) {
code: 'MODULE_NOT_FOUND',
path: 'C:\\Users\\Martin Carrasco\\Desktop\\BurnoutZero\\boz-google-chat-app\\node_modules\\https-proxy-agent\\package.json',
requestPath: 'https-proxy-agent'
}
And here is my code:
const chat = require('@googleapis/chat');
async function createMessage() {
const auth = new chat.auth.GoogleAuth({
// Specify service account details.
keyFilename: 'credentials.json',
// Specify required scopes.
scopes: ['https://www.googleapis.com/auth/chat.bot']
});
const authClient = await auth.getClient();
// Create the Chat API client and authenticate with the service account.
const chatClient = await chat.chat({
version: 'v1',
auth: authClient
});
// Create a Chat message.
const result = await chatClient.spaces.messages.create({
// The space to create the message in.
//
// Replace SPACE_NAME with a space name.
// Obtain the space name from the spaces resource of Chat API,
// or from a space's URL.
parent: 'spaces/AAAAxqmzN8I',
// The message to create.
requestBody: { 'text': 'Hello, world!' }
});
return result;
}
// Execute function then print details about the created message.
(async() => {
const r = await createMessage();
console.log(r);
})()
I tried using all this node versions:
- 21.6.1 (Currently using 64-bit executable)
21.6.0
20.11.0
18.0.0
17.0.0
with no success. The only thing that worked for my was downgrading my googlechat api version to 17.0.1
- 主要语言
- TypeScript
- 星标
- 12.3k
- 派生
- 2k
- 平均合并
- 3 天 10 小时
- 30 天内合并 PR
- 9
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
googleapis/google-api-nodejs-client 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 86/100
googleapis/google-api-nodejs-client#4064 ·
维护者通常 2 天内回复
-
难度 4/5 1-2 天 新手友好度 5/100
googleapis/google-api-nodejs-client#4067 ·
维护者通常 2 天内回复
-
难度 5/5 一周以上 新手友好度 1/100
googleapis/google-api-nodejs-client#4063 ·
维护者通常 2 天内回复
-
eMudhra/emSign CA compromise (October 2026): what Cloud SDK Node.js Libraries developers need to do未关闭
难度 1/5 1 小时以内 新手友好度 10/100
googleapis/google-api-nodejs-client#4062 ·
维护者通常 2 天内回复
-
难度 5/5 一周以上 新手友好度 10/100
googleapis/google-api-nodejs-client#4061 ·
维护者通常 2 天内回复
查看 googleapis/google-api-nodejs-client 的全部 Issue
相似的 Issue
-
bug UI
难度 2/5 1-3 小时 新手友好度 70/100
wardian-app/Wardian#1746 ·
维护者通常 1 天内回复
-
area: interop area: sip-core v3
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
难度 2/5 1-3 小时 新手友好度 72/100
openclaw/openclaw#198551 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复