question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Cannot find module './build/Release/re2'

See original GitHub issue

Bug 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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8

github_iconTop GitHub Comments

2reactions
mschipperheyncommented, Dec 3, 2021

The PR doesn’t resolve the problem

1reaction
chiragshah0312commented, Dec 5, 2020

working on windows but not on linux

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues - GitHub
The issue appears to occur when a module rebuild occurs. It seems that yarn will delete built modules more aggressively than npm when...
Read more >
Your Answer - Stack Overflow
Error : Cannot find module './build/Release/re2'. NB: The project is managed by npm. The regex checks if an email is correct in a...
Read more >
node-re2 - Bountysource
Cannot find module './build/Release/re2' ... Hi! So I noticed you have some unusual errors with yarn, but I just encountered this same problem ......
Read more >
Electron/Node error in re2 module - Reddit
After updating an app to Electron 10.1. 1, I get this error in the console with an RSS app I'm working on.
Read more >
Kibana 7.11.1 failing on Docker 7 Raspberry PI4 (arm7)
I can build the image, however I hit the following error on docker ... ":"Error: /usr/share/kibana/node_modules/re2/build/Release/re2.node: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found