Error: Cannot find module './build/Release/re2'
See original GitHub issueBug Report
Read the Notes and fill out the form.
Notes
Your issue will be closed if you violate any rule below.
- You need to include a meaningful section of your code (not your entire project and not a single line).
- Please do not add screenshots as they’re not easy to work with.
- Errors like
IgActionSpamError (feedback_required)
,IgCheckpointError (challenge_required)
,checkpont_required
,login_required
are “common” and there are multiple issues, search here. - You can delete this section after reading it.
Form
Put an [x]
if you meet the condition, else leave [ ]
.
Requirements
- I’ve searched the Issues
- I’ve read the basic concepts
- I’m using the latest version
- I’ve debugged my code using the
DEBUG
variable.
Platform
- I’m using Node.js version
v13.11.0 (node -v)
- I’m using electron
- I’m using the browser
Google Chrome Version 87.0.4280.88 (Official Build) (64-bit)
- I’m using some other environment
Windows 10
Description
A specific description of your bug, so it’s understandable to anyone.
If you have pictures or videos to upload, please add a link like this: [title](url)
.
YOUR DESCRIPTION HERE
When I run the code with the node it seems that the re2
and url-regex-safe
modules were not found, although they are inside my node_modules
. I ran the same code within my Windows for Linux subsystems and it worked fine, it seems that the package does not work on Windows 10 or is just on my machine.
Code
Add a meaningful section of your code here. If you are using TypeScript replace js
with typescript
.
import { IgApiClient } from 'instagram-private-api';
import { sample } from 'lodash';
import { get } from 'request-promise'; // request is already declared as a dependency of the library
import Snoowrap from "snoowrap";
import snoowrap from 'snoowrap'
export class Bot {
private ig: IgApiClient;
public r: Snoowrap;
constructor() {
this.ig = new IgApiClient();
Error and Output
If you’ve got an error put it here.
You can get the stacktrace in the most environments using
Error.stack
(MDN Docs).
Done in 3.28s.
internal/modules/cjs/loader.js:979
throw err;
^
hread.entity.js:3:18)
Error: Cannot find module './build/Release/re2'
Require stack:
- C:\Users\Pedro Barbosa\Javascript\Projetos\instagram-bot\node_modules\re2\re2.js
- C:\Users\Pedro Barbosa\Javascript\Projetos\instagram-bot\node_modules\url-regex-safe\lib\index.js
- C:\Users\Pedro Barbosa\Javascript\Projetos\instagram-bot\node_modules\instagram-private-api\dist\entities\direct-thread.entity.js
- C:\Users\Pedro Barbosa\Javascript\Projetos\instagram-bot\node_modules\instagram-private-api\dist\entities\index.js
- C:\Users\Pedro Barbosa\Javascript\Projetos\instagram-bot\node_modules\instagram-private-api\dist\responses\discover.feed.response.js
- C:\Users\Pedro Barbosa\Javascript\Projetos\instagram-bot\node_modules\instagram-private-api\dist\responses\index.js .js',
- C:\Users\Pedro Barbosa\Javascript\Projetos\instagram-bot\node_modules\instagram-private-api\dist\feeds\account-followers.feed.js
- C:\Users\Pedro Barbosa\Javascript\Projetos\instagram-bot\node_modules\instagram-private-api\dist\feeds\index.js nse.js',
- C:\Users\Pedro Barbosa\Javascript\Projetos\instagram-bot\node_modules\instagram-private-api\dist\core\feed.factory.js
- C:\Users\Pedro Barbosa\Javascript\Projetos\instagram-bot\node_modules\instagram-private-api\dist\core\client.js js',
- C:\Users\Pedro Barbosa\Javascript\Projetos\instagram-bot\node_modules\instagram-private-api\dist\index.js
- C:\Users\Pedro Barbosa\Javascript\Projetos\instagram-bot\dist\bot.js
- C:\Users\Pedro Barbosa\Javascript\Projetos\instagram-bot\dist\main.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:976:15)
at Function.Module._load (internal/modules/cjs/loader.js:859:27)
at Module.require (internal/modules/cjs/loader.js:1036:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (C:\Users\Pedro Barbosa\Javascript\Projetos\instagram-bot\node_modules\re2\re2.js:3:13)
at Module._compile (internal/modules/cjs/loader.js:1147:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
at Module.load (internal/modules/cjs/loader.js:996:32)
at Function.Module._load (internal/modules/cjs/loader.js:896:14) u, se um caminho tiver sido incluído,
at Module.require (internal/modules/cjs/loader.js:1036:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (C:\Users\Pedro Barbosa\Javascript\Projetos\instagram-bot\node_modules\url-regex-safe\lib\index.js:9:11)
at Module._compile (internal/modules/cjs/loader.js:1147:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
at Module.load (internal/modules/cjs/loader.js:996:32)
at Function.Module._load (internal/modules/cjs/loader.js:896:14)
at Module.require (internal/modules/cjs/loader.js:1036:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (C:\Users\Pedro Barbosa\Javascript\Projetos\instagram-bot\node_modules\instagram-private-api\dist\entities\direct-thread.entity.js:3:18)
at Module._compile (internal/modules/cjs/loader.js:1147:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
at Module.load (internal/modules/cjs/loader.js:996:32) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\Pedro Barbosa\\Javascript\\Projetos\\instagram-bot\\node_modules\\re2\\re2.js',
'C:\\Users\\Pedro Barbosa\\Javascript\\Projetos\\instagram-bot\\node_modules\\url-regex-safe\\lib\\index.js',
'C:\\Users\\Pedro Barbosa\\Javascript\\Projetos\\instagram-bot\\node_modules\\instagram-private-api\\dist\\entities\\direct-thread.entity.js',
'C:\\Users\\Pedro Barbosa\\Javascript\\Projetos\\instagram-bot\\node_modules\\instagram-private-api\\dist\\entities\\index.js',
'C:\\Users\\Pedro Barbosa\\Javascript\\Projetos\\instagram-bot\\node_modules\\instagram-private-api\\dist\\responses\\discover.feed.response.js',
'C:\\Users\\Pedro Barbosa\\Javascript\\Projetos\\instagram-bot\\node_modules\\instagram-private-api\\dist\\responses\\index.js',
'C:\\Users\\Pedro Barbosa\\Javascript\\Projetos\\instagram-bot\\node_modules\\instagram-private-api\\dist\\feeds\\account-followers.feed.js',
'C:\\Users\\Pedro Barbosa\\Javascript\\Projetos\\instagram-bot\\node_modules\\instagram-private-api\\dist\\feeds\\index.js',
'C:\\Users\\Pedro Barbosa\\Javascript\\Projetos\\instagram-bot\\node_modules\\instagram-private-api\\dist\\core\\feed.factory.js',
'C:\\Users\\Pedro Barbosa\\Javascript\\Projetos\\instagram-bot\\node_modules\\instagram-private-api\\dist\\core\\client.js',
'C:\\Users\\Pedro Barbosa\\Javascript\\Projetos\\instagram-bot\\node_modules\\instagram-private-api\\dist\\index.js',
'C:\\Users\\Pedro Barbosa\\Javascript\\Projetos\\instagram-bot\\dist\\bot.js',
'C:\\Users\\Pedro Barbosa\\Javascript\\Projetos\\instagram-bot\\dist\\main.js'
]
}
YOUR OUTPUT GOES HERE
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8
Top GitHub Comments
The PR doesn’t resolve the problem
working on windows but not on linux