create react app npm run start don't find a module - javascript

Error: Cannot find module 'C:\Users\hp\Desktop\Project\node_modules\raw-body\node_modules\iconv-lite\lib\index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:353:19)
at Function.Module._findPath (node:internal/modules/cjs/loader:566:18)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
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:\Users\hp\Desktop\Project\node_modules\raw-body\index.js:18:13)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32) {
code: 'MODULE_NOT_FOUND',
path: 'C:\\Users\\hp\\Desktop\\Project\\node_modules\\raw-body\\node_modules\\iconv-lite\\package.json',
requestPath: 'iconv-lite'
}
I try delete package.json and run npm install
I try delete node_module and run npm install
both tries doesn't word.

Related

Error: Cannot find module '../build/Release/wrtc.node'

I`m a student and I facing such bug when I try webtorrent on nodejs on windows10.
Error: Cannot find module '../build/Release/wrtc.node'
Require stack:
- E:\node\hls\node_modules\wrtc\lib\binding.js
- E:\node\hls\node_modules\wrtc\lib\index.js
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> (E:\node\hls\node_modules\wrtc\lib\binding.js:6:20)
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',
requireStack: [
'E:\\node\\hls\\node_modules\\wrtc\\lib\\binding.js',
'E:\\node\\hls\\node_modules\\wrtc\\lib\\index.js'
]
}
Same error on both local insatll and global install.
I checked the path, it is ok.
Since the problem is all about wrtc modle, I download the wrtc modle through npm and build it. After I built it successfully I replace the oingianl node_modules by the wrtc`s.

I am getting error message when I run the application file

I am having trouble running the server file in this solution .
removed the other solution that was in the same directory
Did npm install for passport. help please I am not sure what else to look at
"C:\Program Files\nodejs\node.exe" -r dotenv/config C:\Users\name\CSC3916_HW2\server.js
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'passport-http'
Require stack:
- C:\Users\name\CSC3916_HW2\auth.js
- C:\Users\name\CSC3916_HW2\server.js
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:\Users\name\CSC3916_HW2\auth.js:3:21)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153: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',
requireStack: [
'C:\\Users\\name\\CSC3916_HW2\\auth.js',
'C:\\Users\\name\\CSC3916_HW2\\server.js'
]
}
Process finished with exit code 1
Server config settings
Based on the below comment
"Are you sure you have installed the necessary dependency passport-http? –
Terry
1 min ago"
I installed npm passport-http that resolved it

uglify Error: Cannot find module 'optimist'

I am going to uglify index.js file. But it throws this error: Cannot find module 'optimist'.
I have installed optimist: npm install optimist but it doesn't work. Anyone can help?
uglifyjs index.js
module.js:550
throw err;
^
Error: Cannot find module 'optimist'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/lib/nodejs/uglify-js/bin/uglifyjs:8:16)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
try this command,
npm i optimist --save
If It does not work then try this,
Delete node_modules folder & package-lock.json
&then try this command,
npm i --save

How to fix 'Error: Cannot find module '/lib/index' on Node JS

I'm adding 1 new library to my project (express-fileupload), but, when run node server this return that message, I tried with the commands:
npm install
npm loader
npm install winston (this for a problem reported in a Github project)
npm start
but this dont work.
$ node server.js
internal/modules/cjs/loader.js:605
throw err;
^
Error: Cannot find module '/lib/index'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:657:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\david\Documents\INTRANET\dusoft-server\server.js:15:18)
at Module._compile (internal/modules/cjs/loader.js:721:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)

Cannot find module 'node-sass-middleware'

When trying to use gulp, I'm having ' Cannot find module 'node-sass-middleware' ' error.
module.js:340
throw err;
^
Error: Cannot find module 'node-sass-middleware'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/wallet/node_modules/gulp-sass/node_modules/node-sass/sass.js:180:22)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
node-sass-middleware is empty for some reason.
I've installed gulp like
sudo npm install -g gulp
node-sass-middleware folder has appeared, but its empty inside but a node_modules folder which is also empty.
/home/wallet/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-sass-middleware/.js
Am I installing gulp wrong?

Categories