help
help copied to clipboard
internal/modules/cjs/loader.js:983 throw err; ^ Could you help me with this code?
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)
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: []
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:
...
> [email protected] postinstall /***/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
> [email protected] 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:
- rm -rf node_modules
- rm -f package-lock.jso
- npm cache clean --force
- reinstall nodejs
- ...
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
-
delete node_modules folder
-
delete package-lock.json file
-
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
[email protected] 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:
- 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... ``
same issue, tried all of the solutions mentioned above, but no use. `` C:\Users\vinod\server>npm start
[email protected] 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 [email protected] 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