help icon indicating copy to clipboard operation
help copied to clipboard

node.js cannot find module on a mac!!!

Open Nemeswat opened this issue 2 years ago • 4 comments

Details

node:internal/modules/cjs/loader:1147
  throw err;
  ^

Error: Cannot find module '/Users/mac/deposit.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v20.11.0
mac@macs-Air-2 ~ %   

Node.js version

Node.js v20.11.0

Example code

node deposit.js yyiecymjvwYE6Wxg4ZSt4ibdfFRo3JUNhQ99AKnaRqu 0x7C9e161ebe55000a3220F972058Fb83273653a6e 1500000 100 3e1bf180e4778c7944f509b422711101186d26ac15337934f12088623755c0b7 https://rpc.sepolia.org/

Operating system

macOS

Scope

code

Module and version

Not applicable.

Nemeswat avatar Jan 23 '24 13:01 Nemeswat

Facing same issue

veerasrikanthv avatar Feb 02 '24 20:02 veerasrikanthv

Have you tried checking if /Users/mac/deposit.js actually exists? You're likely trying to run your JavaScript file from the incorrect directory. /Users/mac is your home directory and your JS file is most likely not there, double-check to make sure and if it's not there then either change your directory to where your JS file actually is using the cd command or specify the correct path to the JS file.

VoltrexKeyva avatar Feb 08 '24 11:02 VoltrexKeyva

Facing same issue

aqifkhan12 avatar Feb 10 '24 08:02 aqifkhan12

Have you tried checking if /Users/mac/deposit.js actually exists? You're likely trying to run your JavaScript file from the incorrect directory. /Users/mac is your home directory and your JS file is most likely not there, double-check to make sure and if it's not there then either change your directory to where your JS file actually is using the cd command or specify the correct path to the JS file.

I am using windows, and my android folder exists, but still facing same issue image

aqifkhan12 avatar Feb 10 '24 08:02 aqifkhan12

Hi! Is this issue still outstanding?

Make sure the file to run exists and is executable.

avivkeller avatar Jun 01 '24 19:06 avivkeller