nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.47k stars 280 forks source link

ERROR - node:internal/modules/cjs/loader:936 throw err; #3709

Closed GabrielCHP closed 2 years ago

GabrielCHP commented 2 years ago

Version

No response

Platform

Windows Powershell

Subsystem

Powershell

What steps will reproduce the bug?

Downloading node.js > Opening the Windows Powershell > Selecting the Folder > node install. # Not working!

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

No response

What do you see instead?

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

Error: Cannot find module 'C:__MACOSX\hashlips\install' ←[90m at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)←[39m ←[90m at Function.Module._load (node:internal/modules/cjs/loader:778:27)←[39m ←[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)←[39m ←[90m at node:internal/main/run_main_module:17:47←[39m { code: ←[32m'MODULE_NOT_FOUND'←[39m, requireStack: [] }

Additional information

BUG

Goldzik2 commented 2 years ago

I have the same problem

shabbir23ah commented 2 years ago

Same problem, any solution??

Glitchbes commented 2 years ago

same shit!

PS C:\hashlips_art_engine-1.1.1_update> node utils/nftport/uploadFiles.js node:internal/modules/cjs/loader:936 throw err; ^

Error: Cannot find module 'C:\hashlips_art_engine-1.1.1_update\utils\nftport\uploadFiles.js' ?[90m at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)?[39m ?[90m at Function.Module._load (node:internal/modules/cjs/loader:778:27)?[39m ?[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)?[39m ?[90m at node:internal/main/run_main_module:17:47?[39m { code: ?[32m'MODULE_NOT_FOUND'?[39m, requireStack: [] }

Soroushj1 commented 2 years ago

same problem

Glitchbes commented 2 years ago

Figured it out. I left some things out in main.js

On Mon, Feb 14, 2022, 5:32 PM Soroushj1 @.***> wrote:

same problem

— Reply to this email directly, view it on GitHub https://github.com/nodejs/help/issues/3709#issuecomment-1039639286, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXQISKOCHJGK4V52RJ5WEELU3F7HVANCNFSM5M7JOBJA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

abvillarreal commented 2 years ago

Hello, the same issue i even tried reinstalling everything, and nothing good happened. I thought the problem was the version because i installed v17.5.0, so i uninstalled and installed v16.14.0 but same thing. I manually tried to install the package with the command npm i npm-cli or command npm install npm-cli The first time before downgrading node version, it was working fine the installation but errors were still there. after the downgrade, doesn't even try to install because immediately after shows the error. Is there anybody who passed through this and is now happily ever after creating new projects..

BR everyone

nkilm commented 2 years ago

Yeah I'm facing similar problem. image

Any solution(s) for this?

AdamSioud commented 2 years ago

I also need help here! much needed, thanks:)

paulius-bulotas commented 2 years ago

Same i need help, thanks for any information 👍

nkilm commented 2 years ago

Recently I was doing one simple project which would show Riddles in Command Line. I published it as npm package, but when I execute it (npx riddles-cli) I get the above mentioned error.

Repository link: https://github.com/nkilm/riddles-in-CLI-a-npm-package

npm package https://www.npmjs.com/package/riddles-cli

marsonya commented 2 years ago

Can someone post a code snippet that can be used to reproduce or an example? Kindly share details of the steps followed and commands. It will help in understanding and resolving the issue.

ralfs66 commented 2 years ago

Following this tutorial results in specified error https://www.youtube.com/watch?v=KkZ6iYnSDRw

nkilm commented 2 years ago

any updates?

dookpook commented 2 years ago

anyone know how to fix already?? its f ing up my discord bot learning process (:

nkilm commented 2 years ago

One thing I observed is that this error occurs when we don't install the required dependencies correctly. But this works only for some cases, but it didn't work for me.

So for now try this,

Hope this helps😅

dookpook commented 2 years ago

yooo thanks man, im gonna try that rn. but how do i re-install the necessary modules?

nkilm commented 2 years ago

Welcome:)

All the type of dependencies are present in package.json file,

So all you have to do is, open your terminal in project folder and execute the below command.

npm i

or

npm install 

Both should work fine😅

dookpook commented 2 years ago

its still giving this error 2022-03-09 17_57_11-Desktop could it maybe be the code?

nkilm commented 2 years ago

Well it seems this method is not working even for you(Even I'm getting the same error).

We'll figure out something.

dookpook commented 2 years ago

could you add me on discord so we could think of a solution or so you could let me now if theres a solutions found? its dookpook#0001

taleleni commented 2 years ago

Hello All, I installed the very latest version 17.7.0 on windows but got the same error :( I even tried restalling and uninstalling too. but the same error coms with version 16 too.

Is there anybody who passed through this . Kindly let me know.

taleleni commented 2 years ago

Welcome:)

All the type of dependencies are present in package.json file,

So all you have to do is, open your terminal in project folder and execute the below command.

npm i

or

npm install 

Both should work fine😅

not working. getting same error

dookpook commented 2 years ago

Welcome:) All the type of dependencies are present in package.json file, So all you have to do is, open your terminal in project folder and execute the below command.

npm i

or

npm install 

Both should work fine😅

not working. getting same error

i know man had the same thing );

Soroushj1 commented 2 years ago

I basically installed node again not through the commandline and it worked! I know it should work the same… but it didnt

Sent from my iPhone

On Mar 9, 2022, at 1:23 PM, dookpook @.***> wrote:

 Welcome:) All the type of dependencies are present in package.json file, So all you have to do is, open your terminal in project folder and execute the below command.

npm i or

npm install Both should work fine😅

not working. getting same error

i know man had the same thing );

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.

dookpook commented 2 years ago

i was thinking of resetting my pc and starting over my project, is this gonna fix the issue?

nkilm commented 2 years ago

could you add me on discord so we could think of a solution or so you could let me now if theres a solutions found? its dookpook#0001

Yeah sure I'll add you!

My discord username: nkilm#7651

nkilm commented 2 years ago

Hello All, I installed the very latest version 17.7.0 on windows but got the same error :( I even tried restalling and uninstalling too. but the same error coms with version 16 too.

Is there anybody who passed through this . Kindly let me know.

Already tried that one, but no luck.

nkilm commented 2 years ago

i was thinking of resetting my pc and starting over my project, is this gonna fix the issue?

I don't think it is related to PC, something with nodejs itself.

dookpook commented 2 years ago

i was thinking of resetting my pc and starting over my project, is this gonna fix the issue?

I don't think it is related to PC, something with nodejs itself.

alr accepted the fr

nkilm commented 2 years ago

Welcome:)

All the type of dependencies are present in package.json file,

So all you have to do is, open your terminal in project folder and execute the below command.

npm i

or

npm install 

Both should work fine😅

One way to reproduce this error and actually fix:

Create one simple express application, but don't install express. Just import and execute the code once. We'll get the above mentioned error.

Now to fix the issue install express using npm i express.

Now which gives us a hint that something is missing from project which is causing this error.

dookpook commented 2 years ago

maybe sounds dumb, how to actually install express? could u help me via discord maybe?

itsme-vivek commented 2 years ago

maybe sounds dumb, how to actually install express? could u help me via discord maybe?

npm install express

greatAznur commented 2 years ago

i have same probleme no soluton ?

greatAznur commented 2 years ago

https://stackoverflow.com/questions/24721903/npm-npm-cli-js-not-found-when-running-npm SET PATH=C:\Program Files\Nodejs;%PATH% ok good

nkilm commented 2 years ago

stackoverflow.com/questions/24721903/npm-npm-cli-js-not-found-when-running-npm SET PATH=C:\Program Files\Nodejs;%PATH% ok good

I had the same path, but still gives me this error:(

jpilgrim commented 2 years ago

I thought I had the same problem... and only after drinking a cup of coffee I noticed my mistake: Instead of npm install I had typed node install... and of course no such module could be found. From the initial error description this looks very similar.

maltin1234 commented 2 years ago

Cd into the right folder. I got this error because I was trying to run from wrong folder

jonasnapoles commented 2 years ago

Unfortunately I have the same problem

jonasnapoles commented 2 years ago

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

Error: Cannot find module 'semver' Require stack:

iamgideonidoko commented 2 years ago

I get a similar error when I run yarn create react-app <app-name>

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

Error: Cannot find module 'ignore'
Require stack:
- C:\IFEXARCHIVE\IFEXPROJECT\graphql-app\frontend5\node_modules\globby\index.js
- C:\IFEXARCHIVE\IFEXPROJECT\graphql-app\frontend5\node_modules\react-scripts\scripts\utils\verifyTypeScriptSetup.js
- C:\IFEXARCHIVE\IFEXPROJECT\graphql-app\frontend5\[eval]
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (C:\IFEXARCHIVE\IFEXPROJECT\graphql-app\frontend5\node_modules\globby\gitignore.js:6:19)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
    'C:\\IFEXARCHIVE\\IFEXPROJECT\\graphql-app\\frontend5\\node_modules\\globby\\gitignore.js',
    'C:\\IFEXARCHIVE\\IFEXPROJECT\\graphql-app\\frontend5\\node_modules\\globby\\index.js',
    'C:\\IFEXARCHIVE\\IFEXPROJECT\\graphql-app\\frontend5\\node_modules\\react-dev-utils\\globby.js',
    'C:\\IFEXARCHIVE\\IFEXPROJECT\\graphql-app\\frontend5\\node_modules\\react-scripts\\scripts\\utils\\verifyTypeScriptSetup.js',
    'C:\\IFEXARCHIVE\\IFEXPROJECT\\graphql-app\\frontend5\\node_modules\\react-scripts\\scripts\\init.js',
    'C:\\IFEXARCHIVE\\IFEXPROJECT\\graphql-app\\frontend5\\[eval]'
  ]
}

How can I resolve this?

jonasnapoles commented 2 years ago

I recommend reinstalling or updating the version

Example

node -v n stable

Ubuntu

sudo npm install n -g sudo n stable

iamgideonidoko commented 2 years ago

I recommend reinstalling or updating the version

I recommend reinstalling or updating the version

Example

node -v n stable

Ubuntu

sudo npm install n -g sudo n stable

I'm currently using the latest stable version of yarn (v1.22.18) and node.js lts (v16.14.2). I still get the error whenever I use yarn to scaffold a React application. Although, when I use npx to generate the react app, it works fine.

I want to use yarn to manage my project's dependencies.

iamgideonidoko commented 2 years ago

Ok. I just fixed it by:

jeremiasmarinho commented 2 years ago

On Windows I solved it like this.

I went to the folder: C:\Users\Documents\AppData\Roaming\npm

And I deleted the file. create-react-app.

I started the project again, and it worked.

greatAznur commented 2 years ago

on window i have repair the nodejs with window add and sup programe shearch node js click to modifie and repair

jonasnapoles commented 2 years ago

Ok. I just fixed it by:

  • adding ignore "ignore": "^5.2.0" in my package.json as a dependency
  • deleteting node_modules folder
  • running yarn install

Very good! It's very similar to all the cases before!

celestinecyr commented 2 years ago

@jonasnapoles do you also have a node_modules in your root? Could you please share the structure of your project for comparison? Thank you!

jonasnapoles commented 2 years ago

image

@celestinecy

jonasnapoles commented 2 years ago

@jonasnapoles do you also have a node_modules in your root? Could you please share the structure of your project for comparison? Thank you!

@celestinecyr This?

celestinecyr commented 2 years ago

Hi @jonasnapoles , I meant, do you have a node_modules folder outside of your client and server folder?

It's working perfectly fine when i try running heroku local,

Screenshot 2022-03-29 at 9 58 00 AM

and I'm able to deploy on heroku too after having a package.json outside of my client and server file:

Screenshot 2022-03-29 at 9 59 39 AM

However it's still Application Error on Heroku even after it builds successfully. Do you have any idea why?

My error: node:internal/modules/cjs/loader:936 2022-03-29T01:47:57.534626+00:00 app[web.1]: throw err; 2022-03-29T01:47:57.534626+00:00 app[web.1]: ^ 2022-03-29T01:47:57.534627+00:00 app[web.1]: 2022-03-29T01:47:57.534627+00:00 app[web.1]: Error: Cannot find module '/app/index.js' 2022-03-29T01:47:57.534628+00:00 app[web.1]: at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) 2022-03-29T01:47:57.534630+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:778:27) 2022-03-29T01:47:57.534630+00:00 app[web.1]: at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) 2022-03-29T01:47:57.534631+00:00 app[web.1]: at node:internal/main/run_main_module:17:47 { 2022-03-29T01:47:57.534631+00:00 app[web.1]: code: 'MODULE_NOT_FOUND', 2022-03-29T01:47:57.534632+00:00 app[web.1]: requireStack: [] 2022-03-29T01:47:57.534632+00:00 app[web.1]: }