Module not found when initializing Chat API
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 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時間
- マージ済み PR(30日)
- 9
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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週間以上 初心者へのやさしさ 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 1週間以上 初心者へのやさしさ 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
fonoster/routr#705 · コメント 1 件 ·
メンテナーはふだん 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 件 ·
メンテナーはふだん 1 日以内に返信