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?
Related
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
I am trying to run a canvas project in local(development) environment by referring https://github.com/instructure/canvas-lms/wiki/Quick-Start
If I try to run rails server then it throws an error like RuntimeError (you need to run webpack). While fixing this issue, I have referred some blogs and try to run webpack server. Again it will throws an error like Error: Cannot find module ...
Example:
module.js:487
throw err;
^
Error: Cannot find module 'yargs'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/local/lib/node_modules/webpack/bin/webpack.js:16:13)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
I am using Ubuntu 16.04 and webpack version is 3.0.0
How can I fix these issues? Please help me to run this canvas project.
Following to my previous question, I'm trying to use protocol buffers in node.js. I've generated ServiceMessage_pb.js from my ServiceMessage.proto, and add the following code:
var messages = require('./ServiceMessage_pb');
Now I'm getting the following error in my node log:
Error: Cannot find module 'google-protobuf'
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> (/home/aii/ws/ServiceMessage_pb.js:8:12)
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)
Any suggestions how to solve this?
Thanks
npm i google-protobuf
I run into so many problem installing just "protobuf" !
Also the official protobuf javascript package is "google-protobuf":
https://www.npmjs.com/package/google-protobuf
You can install the module with npm:
npm install --save protobuf
Then require it this way:
var my_protobuff = require ("protobuf");
I have updated my node to latest one.
I have also tried uninstalled and reinstalled the node one time to fix this problem but no success.
I have also run the command sudo npm install -g to-fast-properties to install this module.
Can anyone help why this error is still coming?
browserify -t babelify app.js -o bundle.js
module.js:338
throw err;
^
Error: Cannot find module 'to-fast-properties'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/saurabhchaudhary/www/react-soundplayer/examples/node_modules/babelify/node_modules/babel-core/lib/types/index.js:23:25)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
By the I am using react library which I would like to browserify my js code to execute in browser. Is there any other way to do same?
I have upgraded from Node.js 0.12.7 to 4.2.1, getting the following error when starting my server:
$ node server.js
C:\Users\me\documents\github\angular-express-auth\node_modules\bcrypt\node_modules\bindings\bindings.js:83
throw e
^
Error: The specified procedure could not be found.
\\?\C:\Users\me\documents\github\angular-express-auth\node_modules\bcrypt\build\Release\bcrypt_lib.node
at Error (native)
at Object.Module._extensions..node (module.js:460:18)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at bindings (C:\Users\me\documents\github\angular-express-auth\node_modules\bcrypt\node_modules\bindings\bindings.js:76:44)
at Object.<anonymous> (C:\Users\me\documents\github\angular-express-auth\node_modules\bcrypt\bcrypt.js:3:35)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (C:\Users\me\documents\github\angular-express-auth\server\config\mongo_database.js:2:14)
at Module._compile (module.js:435:26)
In fact the node-gyp build is failing that's causing this specific issue or vice-versa, not sure how exactly both are linked.It was working perfectly fine till the Node.js version upgrade. I have the dependencies installed (Python v2.7.3,Microsoft Visual c++ 2015), have the environmental variables setup correctly too. Please help.
It's a problem with the version mismatch between node js and bcrypt module. Uninstalled bcrypt using npm in my project and reinstalled the same, now it's successfully building the node-gyp module (bcrypt installation always builds the node-gyp and creates a new binding file) and the app is running.