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
Related
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.
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 don't get any errors in dev or in the process of actually building via npm run build, but upon trying to run node __sapper__/build on my linux VM I get a Cannot find module error
/opt/bitnami/apps/bookbot/htdocs$ node __sapper__/build
Starting server on port 3000
internal/modules/cjs/loader.js:628
throw err;
^Error: Cannot find module 'lodash/groupby'
Require stack:
- /opt/bitnami/apps/bookbot/htdocs/__sapper__/build/server/bookings-b0b7de1b.js
- /opt/bitnami/apps/bookbot/htdocs/__sapper__/build/server/server.js
- /opt/bitnami/apps/bookbot/htdocs/__sapper__/build/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
at Function.Module._load (internal/modules/cjs/loader.js:527:27)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/opt/bitnami/apps/bookbot/htdocs/__sapper__/build/server/bookings-b0b7de1b.js:10:1)
at Module._compile (internal/modules/cjs/loader.js:777:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:788:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/opt/bitnami/apps/bookbot/htdocs/__sapper__/build/server/bookings-b0b7de1b.js',
'/opt/bitnami/apps/bookbot/htdocs/__sapper__/build/server/server.js',
'/opt/bitnami/apps/bookbot/htdocs/__sapper__/build/index.js'
]}
I've tried npm i lodash --save, makes no difference. Not sure where I'm going wrong?
Shouldn't it be lodash/groupBy with an uppercase 'B'? How do you make that pass in dev?
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)
I have all updated version of node,npm,sass but when i add gulp-sass in gulpfile and run npm start its showing following error:
$ npm start
> Dashboard#1.0.0 start D:\Projects\Dashboard
> gulp
module.js:327
throw err;
^
Error: Cannot find module 'ansi-regex'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (D:\Projects\Dashboard\node_modules\gulp-sass\node_modules\gulp-util\node_modules\chalk\node_modules\strip-ansi\index.js:2:17)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)