Closed skeddles closed 1 year ago
Please answer the following questions in order for us to help you:
node-fetch
?node v16.17 ^3.0.0 (latest) ^3.3.1 (latest)
That is the issue, we don't support Node JS 16 in version 3.x of Octokit
I agree that the message might be confusing, reopening to track a possible wording of the message
you cannot combine require
and import
statements. If you use CommonJS (require
), then install node-fetch@2
and try this
const { Octokit } = require("octokit");
const fetch = require("node-fetch");
const octokit = new Octokit({ auth: KEY, request: {fetch} });
But as @wolfy1339 mentioned, while this might work, we dropped official support for Node 16. Node 16 will no longer be maintained at all in two months: https://nodejs.dev/en/about/releases/.
Closing in favor of #2457
Describe the need
Error: Global "fetch" not found. Please provide
options.request.fetch
to octokit or upgrade to node@18 or newer.I've tried every combination I can think of, and can't get it to work. Please provide a working example of how I am supposed to make this work.
SDK Version
No response
API Version
No response
Relevant log output
Code of Conduct