npm throwing error about missing module '../' - node.js

I'm running a react-native app right now, and even though the simulation runs perfectly on iOS when I run react-native run-ios, if I run npm start to run the app on a physical device, npm throws the following error:
> Project#0.0.1 start /Users/zavtra/Development/App-RN
> node node_modules/react-native/local-cli/cli.js start
module.js:442
throw err;
^
Error: Cannot find module '../'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/zavtra/Development/App-RN/node_modules/.bin/which:2:13)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
How can a module be named ../? I didn't change anything in the modules and I can't figure out why this error is suddenly occurring. Is there something I have to install/uninstall for the server to work again?
I ran npm install as well and updated my npm/node. No dice.

Related

Can't deploy my node.js app anymore on ubuntu

An old app at work stoped working on an aws machine. I've been assigned the task, but I'm more of a Rails guy. And this is node.js using an old Sails. I tried a bunch of stuff and now even my npm seem broken. I get this error:
ubuntu#ip-172-31-5-52:~$ npm -v
internal/modules/cjs/loader.js:605
throw err;
^
Error: Cannot find module 'are-we-there-yet'
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:659:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js:2:16)
at Module._compile (internal/modules/cjs/loader.js:723:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:734: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)

Electron sqlite3 package app module not found

When I run the packaged electron app for windows(which includes sqlite3), I get the following error:
Knex: run
$ npm install sqlite3 --save
Error: Cannot find module 'C:\Users\User\Desktop\Shoppinglist2-win32-ia32\resour
ces\app.asar\node_modules\sqlite3\lib\binding\electron-v2.0-win32-ia32\node_sqli
te3.node'
at Module._resolveFilename (module.js:543:15)
at Function.Module._resolveFilename (C:\Users\User\Desktop\Shoppinglist2-win
32-ia32\resources\electron.asar\common\reset-search-paths.js:35:12)
at Function.Module._load (module.js:473:25)
at Module.require (module.js:586:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\User\Desktop\Shoppinglist2-win32-ia32\resour
ces\app.asar\node_modules\sqlite3\lib\sqlite3.js:4:15)
at Object.<anonymous> (C:\Users\User\Desktop\Shoppinglist2-win32-ia32\resour
ces\app.asar\node_modules\sqlite3\lib\sqlite3.js:190:3)
at Module._compile (module.js:642:30)
at Object.Module._extensions..js (module.js:653:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:504:12)
at Function.Module._load (module.js:496:3)
at Module.require (module.js:586:17)
at require (internal/module.js:11:18)
at Client_SQLite3._driver (C:\Users\User\Desktop\Shoppinglist2-win32-ia32\re
sources\app.asar\node_modules\knex\lib\dialects\sqlite3\index.js:75:12)
at Client_SQLite3.initializeDriver (C:\Users\User\Desktop\Shoppinglist2-win3
2-ia32\resources\app.asar\node_modules\knex\lib\client.js:219:26)
If I package the app for Linux it workes fine.
PS: Sqlite3 is included as a normal dependency and if i execute the app by npm start it workes fine. And I took care of the rebuild process
Thank you :-)

gulp dev cant be run because of mistake

I run npm install in the project's root and then when I try to run gulp de, I get the following mistake:
$ gulp dev
module.js:442
throw err;
^
Error: Cannot find module './lib/public/public-utils'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\ente\node_modules\browser-sync\index.js:9:21)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\ente\gulpfile.js:27:21)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Liftoff.handleArguments (C:\Users\Man\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:116:3)
at Liftoff.<anonymous> (C:\Users\Man\AppData\Roaming\npm\node_modules\gulp\node_modules\liftoff\index.js :193:16)
at module.exports (C:\Users\Man\AppData\Roaming\npm\node_modules\gulp\node_modules\flagged- respawn\index.js:17:3)
at Liftoff.<anonymous> (C:\Users\Man\AppData\Roaming\npm\node_modules\gulp\node_modules\liftoff\index.js:185:9)
at C:\Users\Man\AppData\Roaming\npm\node_modules\gulp\node_modules\liftoff\index.js: 159:9
at C:\Users\Man\AppData\Roaming\npm\node_modules\gulp\node_modules\v8flags\index.js:108:14
at C:\Users\Man\AppData\Roaming\npm\node_modules\gulp\node_modules\v8flags\index.js:36:12
at C:\Users\Man\AppData\Roaming\npm\node_modules\gulp\node_modules\v8flags\index.js:47:7
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:577:11)
at run (bootstrap_node.js:352:7)
at startup (bootstrap_node.js:144:9)
at bootstrap_node.js:467:3
the gulp file
i tried different things, like to go to an older node, to the latest one, reinstalled node, npm and gulp billions of times, but it didnt help.
What can it be and how to fix it?
The error seems to happen when you require the browser-sync module in your gulpfile. The module doesn't find one of it's own components ./lib/public/public-utils and can't start.
I'd first check in your node_modules directory to see what's going on with browser-sync.
It's usually a corrupted install of the module.
Make sure that in your package.json you have browser-sync listed with the most up-to-date version (2.13.0) and to get a fresh install delete your node_modules directory, npm cache clean
and run npm install again.

node server error - bindings.js crashing

I made this app 1-2 years ago, and I was new to node so I didn't make a proper package.json file when it was created. for some reason, it's not running any more. here is the error when i try to run server.js.
elliott:nodejs_websocket_osc mrtunes$ node server.js
info - socket.io started
/Users/mrtunes/Documents/webmusic/nodejs_websocket_osc/node_modules/node-osc/node_modules/osc-min/node_modules/binpack/node_modules/bindings/bindings.js:83
throw e
^
Error: Module did not self-register.
at Error (native)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at bindings (/Users/mrtunes/Documents/webmusic/nodejs_websocket_osc/node_modules/node-osc/node_modules/osc-min/node_modules/binpack/node_modules/bindings/bindings.js:76:44)
at Object.<anonymous> (/Users/mrtunes/Documents/webmusic/nodejs_websocket_osc/node_modules/node-osc/node_modules/osc-min/node_modules/binpack/index.js:1:99)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
it looks like the bindings module is from the osc-min folder. i tried to go in there and run an npm install but no luck. i put everything on the github

Error: Cannot find module '../deps/console.log'

I'm on OS X 10.8.2, with Node.js 0.10.0 installed via homebrew. When I try to run npm test on nodegit, I get the following error:
cd test && nodeunit *.js
module.js:340
throw err;
^
Error: Cannot find module '../deps/console.log'
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> (/Users/faceleg/Work/Web/js-apprentice.com/Site/node_modules/nodegit/node_modules/.bin/nodeunit:11:1)
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 Function.Module.runMain (module.js:497:10)
npm ERR! Test failed. See above for more details.
npm ERR! not ok code 0
I've done npm update && npm -g update since installing node 0.10.0.
How might I go about fixing this?
The stack trace says it all, it's an issue with nodeunit. I'd file an issue on their issues page.
Not knowing much about nodeunit, it looks like it's anticipating being run from a different location. It's trying to require the file /Users/faceleg/Work/Web/js-apprentice.com/Site/node_modules/nodegit/node_modules/deps/console.log.js which is (probably) actually located at /Users/faceleg/Work/Web/js-apprentice.com/Site/node_modules/nodegit/node_modules/nodeunit/deps/console.log.js.

Resources