In this post, we will see how to resolve Error [ERR_MODULE_NOT_FOUND]: Cannot find package ‘octokit’ imported
Question:
I am trying to run this javascript:myrepo/src/sample.js
myrepo/package.json
Best Answer:
It looks like you’re looking for the@octokit/core
module instead of simply octokit
(note: they are two distinct NPM packages, but you only have @octokit/core
installed). From the README:Install with npm install @octokit/core const { Octokit } = require("@octokit/core"); // or: import { Octokit } from "@octokit/core";
So, try changing this line in your code
octokit
package, then you’ll need run npm install octokit
to install that package. You’ll probably want to run npm remove @octokit/core
to remove the other (more minimal) package too.If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com
Leave a Review