Closed duol45 closed 6 months ago
Hello, can you give more information?
I also get the same error on running cd ios && pod install && cd ../ && react-native run-ios
Trying to get the react native up and running.
Hello,
I'm having the same problem as stated above. When type {node index.js } I get the error below, I tried number of solutions ie uninstalled node and npm then reinstalled then back separately. I'm still getting the same error, help needed.
The error:
interactive-SVG-image git:(master) ✗ node index.js
internal/modules/cjs/loader.js:983
throw err;
^
Error: Cannot find module '/Users/lish/code/JavaScript_projects/interactive-SVG-image/index.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
at Function.Module._load (internal/modules/cjs/loader.js:862:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
delete node module and install again
same errors:
...
> core-js-pure@3.6.5 postinstall /***/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
> ejs@2.7.4 postinstall /***/node_modules/ejs
> node ./postinstall.js
internal/modules/cjs/loader.js:969
throw err;
^
Error: Cannot find module '/***/node_modules/ejs/postinstall.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
at Function.Module._load (internal/modules/cjs/loader.js:842:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
Tried many ways:
versions: npm: '6.14.5', ares: '1.16.0', brotli: '1.0.7', cldr: '37.0', http_parser: '2.9.3', icu: '67.1', llhttp: '2.0.4', modules: '72', napi: '6', nghttp2: '1.41.0', node: '12.18.1', openssl: '1.1.1g', tz: '2019c', unicode: '13.0', uv: '1.38.0', v8: '7.8.279.23-node.38', zlib: '1.2.11'
Work for me: If you are trying to work with node (backend) & react native (fronted) try:
1. Create new main folder (mkdir rootProjectName)
2. from ProjectName/backend > init the node side (npm init --yes )
3. from ProjectName/> init the react side ( react-native init fronted )
:)
Hello,
I'm having the same problem as stated above. When type {node index.js } I get the error below, I tried number of solutions ie uninstalled node and npm then reinstalled then back separately. I'm still getting the same error, help needed.
The error:
interactive-SVG-image git:(master) ✗ node index.js internal/modules/cjs/loader.js:983 throw err; ^ Error: Cannot find module '/Users/lish/code/JavaScript_projects/interactive-SVG-image/index.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15) at Function.Module._load (internal/modules/cjs/loader.js:862:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) at internal/main/run_main_module.js:18:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }
I do have the same issue .I tried many solutions ,I am feeling frustrated to solve this 🤣
Example index.js as module:
var productList = [{name: "banana"},{name: "apple"} ];
module.exports = { productList };
**Same Error! help**
Hello, I'm having the same problem as stated above. When type {node index.js } I get the error below, I tried number of solutions ie uninstalled node and npm then reinstalled then back separately. I'm still getting the same error, help needed. The error:
interactive-SVG-image git:(master) ✗ node index.js internal/modules/cjs/loader.js:983 throw err; ^ Error: Cannot find module '/Users/lish/code/JavaScript_projects/interactive-SVG-image/index.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15) at Function.Module._load (internal/modules/cjs/loader.js:862:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) at internal/main/run_main_module.js:18:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }
I do have the same issue .I tried many solutions ,I am feeling frustrated to solve this 🤣
yes i Fix it
npm cache clean --force
npm install
I am struggling with this same issue. I followed the fix as well and it is not working for me. I am on windows 10 if that makes any difference. It seems to not be downloading the complete fileset of Node. Any help would be amazing.
same issue, tried all of the solutions mentioned above, but no use. `` C:\Users\vinod\server>npm start
server@1.0.0 start C:\Users\vinod\server nodemon expGqlServer.js
[nodemon] 2.0.4
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node expGqlServer.js
internal/modules/cjs/loader.js:968
throw err;
^
Error: Cannot find module '../../temp' Require stack:
same issue, tried all of the solutions mentioned above, but no use. `` C:\Users\vinod\server>npm start
server@1.0.0 start C:\Users\vinod\server nodemon expGqlServer.js
[nodemon] 2.0.4 [nodemon] to restart at any time, enter
rs
[nodemon] watching path(s): . [nodemon] watching extensions: js,mjs,json [nodemon] startingnode expGqlServer.js
internal/modules/cjs/loader.js:968 throw err; ^Error: Cannot find module '../../temp' Require stack:
- C:\Users\vinod\server\resolvers\post.js
- C:\Users\vinod\server\node_modules@graphql-toolkit\file-loading\index.cjs.js
- C:\Users\vinod\server\node_modules\merge-graphql-schemas\index.cjs.js
- C:\Users\vinod\server\expGqlServer.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15) at Function.Module._load (internal/modules/cjs/loader.js:841:27) at Module.require (internal/modules/cjs/loader.js:1025:19) at require (internal/modules/cjs/helpers.js:72:18) at Object. (C:\Users\vinod\server\resolvers\post.js:2:14) at Module._compile (internal/modules/cjs/loader.js:1137:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) at Module.load (internal/modules/cjs/loader.js:985:32) at Function.Module._load (internal/modules/cjs/loader.js:878:14) at Module.require (internal/modules/cjs/loader.js:1025:19) { code: 'MODULE_NOT_FOUND', requireStack: [ 'C:\Users\vinod\server\resolvers\post.js', 'C:\Users\vinod\server\node_modules\@graphql-toolkit\file-loading\index.cjs.js', 'C:\Users\vinod\server\node_modules\merge-graphql-schemas\index.cjs.js', 'C:\Users\vinod\server\expGqlServer.js' ] } [nodemon] app crashed - waiting for file changes before starting... ``
I fixed the issue by using and trying different versions of node. It took a while to find the right one but I eventually did.
I fixed the issue, apparently whenever you change your project directory some node modules will be imported automatically by node.js and along with it, some file paths inside the project will be changed.
In my case when I moved my project to a different folder,
../temp
was changed to,
../../temp
I deleted the ../
and now it's working fine.
Where did you find the temp file?
node js can only run app.js like you execute main function in other programming languages!
Thanks guys, this blog helped me so much to solve my problem with node!
To anyone who stumbled upon this issue. All the above haven't worked for me, while deleting all the whitespaces from the path worked perfectly. As i see, topicstarter also has a whitespace in the path. This might've been the issue.
First, check the path of your current folder under terminal else you will just run this command line :
rm -rf node_modules package-lock.json && npm install && npm start
Am also facing the same issue... here is the solution from my end. if index.js not in our root folder means, we will getting error, once you move to root folder then server will be running
Am also facing the same issue... here is the solution from my end. if index.js not in our root folder means, we will getting error, once you move to root folder then server will be running
Worked for me.
I too got faced the same issue . I got rid that finally by removing node modules that got installed twice and twice.
On Sat, Sep 12, 2020 at 12:08 AM Naimur Rahman notifications@github.com wrote:
Am also facing the same issue... here is the solution from my end. if index.js not in our root folder means, we will getting error, once you move to root folder then server will be running
Worked for me.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nodejs/help/issues/2644#issuecomment-691252336, or unsubscribe https://github.com/notifications/unsubscribe-auth/APY4QRXSA3CUOMDUQPWGBEDSFJVDVANCNFSM4MP5B33A .
I got faced the same issue and I solved it finally.
In my case I was performing git push heroku main
which also main
isn't the default branch.
I had to go to master branch first(default branch), merge the code with my other branch and then heroku git:remote -a <repoName>
and git push heroku master
.
HOPE this can help!
Oh my god!! i was struggling on this, tried everything, in the end, found out my file name was sever.js
@duol45 - is there anything pending in this issue?
If someone still stuck, leave a comment.
2020-10-13T04:57:12.561758+00:00 app[Worker.1]: internal/modules/cjs/loader.js:883
2020-10-13T04:57:12.561775+00:00 app[Worker.1]: throw err;
2020-10-13T04:57:12.561775+00:00 app[Worker.1]: ^
2020-10-13T04:57:12.561776+00:00 app[Worker.1]:
2020-10-13T04:57:12.561776+00:00 app[Worker.1]: Error: Cannot find module './config.json'
2020-10-13T04:57:12.561776+00:00 app[Worker.1]: Require stack:
2020-10-13T04:57:12.561777+00:00 app[Worker.1]: - /app/index.js
2020-10-13T04:57:12.561778+00:00 app[Worker.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
2020-10-13T04:57:12.561778+00:00 app[Worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:725:27)
2020-10-13T04:57:12.561778+00:00 app[Worker.1]: at Module.require (internal/modules/cjs/loader.js:952:19)
2020-10-13T04:57:12.561779+00:00 app[Worker.1]: at require (internal/modules/cjs/helpers.js:88:18)
2020-10-13T04:57:12.561779+00:00 app[Worker.1]: at Object.
@MOSMOSterTVZall - can you elaborate your issue more please? which command you are trying to run ? for me by looking at the error log your issue looks like there is a missing config.json in your current working path. make sure it is configured properly and if that is not the case try to add explicitly to the package.json hope it may help.
Hello, I'm having the same problem as stated above. When type {node index.js } I get the error below, I tried number of solutions ie uninstalled node and npm then reinstalled then back separately. I'm still getting the same error, help needed. The error:
interactive-SVG-image git:(master) ✗ node index.js internal/modules/cjs/loader.js:983 throw err; ^ Error: Cannot find module '/Users/lish/code/JavaScript_projects/interactive-SVG-image/index.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15) at Function.Module._load (internal/modules/cjs/loader.js:862:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) at internal/main/run_main_module.js:18:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }
I do have the same issue .I tried many solutions ,I am feeling frustrated to solve this 🤣
yes i Fix it
npm cache clean --force
delete node_modules folder
delete package-lock.json file
npm install
Worked for me thanks
Please HELP!!! I have tried deleting the node_modules and json files multiple times. Nothing working for me.
$ nodemon script.js
[nodemon] 2.0.6
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node script.js script.js
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module 'C:\Users\Ankur\Desktop\node-website\script.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15) at Function.Module._load (internal/modules/cjs/loader.js:687:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } [nodemon] app crashed - waiting for file changes before starting...
Interesante, me salia el mismo error y era porque no estaba ejecutando mi js desde la carpeta del archivo.
Hello, I'm having the same problem as stated above. When type {node index.js } I get the error below, I tried number of solutions ie uninstalled node and npm then reinstalled then back separately. I'm still getting the same error, help needed. The error:
interactive-SVG-image git:(master) ✗ node index.js internal/modules/cjs/loader.js:983 throw err; ^ Error: Cannot find module '/Users/lish/code/JavaScript_projects/interactive-SVG-image/index.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15) at Function.Module._load (internal/modules/cjs/loader.js:862:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) at internal/main/run_main_module.js:18:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }
I do have the same issue .I tried many solutions ,I am feeling frustrated to solve this 🤣
yes i Fix it
npm cache clean --force
delete node_modules folder
delete package-lock.json file
npm install
Worked with this solution! Thank you
This is probably really dumb but for me, the problem was vs code automatically added an import to the top without me noticing. And that was not a part of my project nor it was something I was using. Simply removing it fixed my issue. There is less than 5% chance that this is the issue but someone watching please do check your imports.
I was trying for an hour doing everything they say but it didn't work, it worked when I created an index.js file without deleting my app.js file, then I went into the package.json file and made a change and saved, then run nodemon again and everything was fine. Then I left the file as it was originally and had no problem, it was weird.
Am also facing the same issue... here is the solution from my end. if index.js not in our root folder means, we will getting error, once you move to root folder then server will be running
Thanks a ton!! Was trying everything but this worked !!!! 👍🏻 Thanks a ton!
Same problem: run webpack-dev-server
> webpack-ts@1.0.0 serve D:\Workspace\code\webpack-ts
> webpack-dev-server
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module 'webpack-cli/bin/config-yargs'
Require stack:
- D:\Workspace\code\webpack-ts\node_modules\webpack-dev-server\bin\webpack-dev-server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (D:\Workspace\code\webpack-ts\node_modules\webpack-dev-server\bin\webpack-dev-server.js:65:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'D:\\Workspace\\code\\webpack-ts\\node_modules\\webpack-dev-server\\bin\\webpack-dev-server.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! webpack-ts@1.0.0 serve: `webpack-dev-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webpack-ts@1.0.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\myname\AppData\Roaming\npm-cache\_logs\2020-12-15T23_17_25_326Z-debug.log
I tried npm cache clean --force
after deleting node_modules and package-lock with no luck.🤷🏽♂️
same error : npm run start then. 883 error make me sad :(
PS D:\D_desktop\study\REACT_BOILERPLATE> npm run start > react_boilerplate@1.0.0 start D:\D_desktop\study\REACT_BOILERPLATE >node ./server/index.js internal/modules/cjs/loader.js:883 throw err; ^ Error: Cannot find module './server/models/User' Require stack:
i tried change path , and tried delete cache, node_modules , install npm again but still not fix :( Has anyone solved 883 problem?
This is probably really dumb but for me, the problem was vs code automatically added an import to the top without me noticing. And that was not a part of my project nor it was something I was using. Simply removing it fixed my issue. There is less than 5% chance that this is the issue but someone watching please do check your imports.
For me, I had "const express = require('express');" somehow vscode added "const express = require('./node_modules/express');". I had to delete ./node_modules part and it resolved the issue. I got the idea of checking that from you. Thanks :)
Tenía el mismo problema: después de instalar npm install react-router-dom - Luego iniciaba el servidor con npm start obtenía el siguiete error:
Error: Cannot find module 'react' Require stack:
react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the front-end@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.Lo solucioné instalando todo la librería npm, es decir instalando npm install.
Espero esto te sirva
hey guys i am also getting the same problem when i try to use webpack - it would be really helpful if anyone could help out here -
@MOSMOSterTVZall - can you elaborate your issue more please? which command you are trying to run ? for me by looking at the error log your issue looks like there is a missing config.json in your current working path. make sure it is configured properly and if that is not the case try to add explicitly to the package.json hope it may help.
can you help to solve this ?
@MOSMOSterTVZall - can you elaborate your issue more please? which command you are trying to run ? for me by looking at the error log your issue looks like there is a missing config.json in your current working path. make sure it is configured properly and if that is not the case try to add explicitly to the package.json hope it may help.
can you help to solve this ?
npm install v8-compile-cache
or delete node modules and reinstall.
If that doesn't work, you need to search for code that uses v8-compile-cache
and commit the issue to that npm module
moi j'ai taper une commande npm run dev sur la terminale de VSCodes mais on m'affiche ces erreurs.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frontend@1.0.0 dev: webpack --mode development --watch
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frontend@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Barry&Sougué\AppData\Roaming\npm-cache_logs\2021-01-07T15_16_05_462Z-debug.log PS C:\Users\Barry&Sougué\Desktop\Gestion-De-Restaurant\Restaurant\frontend> j'ai essayer beaucoup des choses jusqu'à présent j'ai pas de solution, stp j'ai besoin d'aide.
First, check the path of your current folder under terminal else you will just run this command line :
rm -rf node_modules package-lock.json && npm install && npm start
This method worked for me
I have the same error:
Error: Cannot find module 'D:\Learn New Tech\Learn Nodejs\index.js' at Function.Module._load (internal/modules/cjs/loader.js:725:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }
After i rewrite the path in srcipt package.jon to right path it works, so you may try rewrite the path, hope this can help
internal/modules/cjs/loader.js:834 throw err; ^
Error: Cannot find module 'C:\Projects\client-stage-fe\dist\server\main.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client@0.0.0 serve:ssr: node dist/server/main.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client@0.0.0 serve:ssr script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\pc\AppData\Roaming\npm-cache_logs\2021-02-09T08_34_40_367Z-debug.log
Tried several times deleting node modules and install again with admin permission. Still not working. any help appreciated
I recently ran into this issue and I realized the solution was pretty simple,
If you're still facing the issue, use "nvm install latest" the error should disappear after updating to the latest node and npm versions and switching to it.
Hi N0mercy00, all you have to do to solve the 883 problem
You should cut (ctrl + x ) your main file (build.js, index.js , server.js) from the folder you saved it in it is in and paste it in your main folder that houses all the subfolders then after that you can re-run node
OR
IF THAT DOESNT WORK OR YOU DONT WANT TO GO THROUGH ALL THAT STRESS
Just cd (change directory) to you main file((build.js, index.js , server.js) if it in a folder then re-run node
same error : npm run start then. 883 error make me sad :(
PS D:\D_desktop\study\REACT_BOILERPLATE> npm run start
react_boilerplate@1.0.0 start D:\D_desktop\study\REACT_BOILERPLATE node ./server/index.js internal/modules/cjs/loader.js:883 throw err; ^ Error: Cannot find module './server/models/User' Require stack:
i tried change path , and tried delete cache, node_modules , install npm again but still not fix :( Has anyone solved 883 problem?
internal/modules/cjs/loader.js:983 throw err; ^
Error: Cannot find module 'D:\Bryan Durán\Desktop\chat-javascript-fullstack-master\index.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
:12) at internal/main/run_main_module.js:18:47 { code: 'MODULE_NOT_FOUND', requireStack: []