I am getting the following error while trying to use the electron-reload module. (which I am not able to understand)
Error: Cannot find module 'app'
at Module._resolveFilename (module.js:455:15)
at Function.Module._resolveFilename (C:\path\Electron\music-player\node_modules\electron\dist\resources\electron.as
ar\common\reset-search-paths.js:35:12)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\path\Electron\music-player\node_modules\electron-reload\main.js:1:90)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
And the main.js has the following for usage of the module
const electron = require('electron')
const app = electron.app
const BrowserWindow = electron.BrowserWindow
require('electron-reload')(__dirname+'/public')
Can anyone guide me how to resolve the problem ?
Looks like you need to update electron-reload to v1.0.0 or later, the release notes claim it was updated to support Electron v1.0.0+.
Related
I am very new using discord's javascript
This is also my first time posting on stackoverflow!
Anyway
Here's the full error
Error: Cannot find module 'discord.js'
Require stack:
- /home/runner/multiple-purpose-discord-bot-like-carlbot/xp.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> (/home/runner/multiple-purpose-discord-bot-like-carlbot/xp.js:1:17)
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)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/home/runner/multiple-purpose-discord-bot-like-carlbot/xp.js' ]
}
To my limited knowledge, this is either i made a typo
OR some package is outdated, here's the full packages list
I also suspect that i incorrectly implemented the amethyste-api i am using, here's my code
It's in a config file, should've i put const mySecret = process.env['ame'] in the main file instead?, I do need it to be in the config for ease of access
npm install discord.js (manually through console/shell)
did do some stuff but stil didn't work
npm xp.js (manually through console/shell)
this is what i am supposed to run on start manually, that what gives the error
You could run the following commands one after the other:
`npm init`
and then
`npm i discord.js`
I've attempted to update my node version by deleting nodejs file from ProgramFilesx86 folder and using the windows installer to install the latest file. When I go to try and initialize a node project or npx create-react-app it gives me the following:
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (C:\Users\Mickell\AppData\Roaming\nvm\v13.8.0\node_modules\npm\node_modules\socks-proxy-agent\dist\agent.js:114:44)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\Mickell\AppData\Roaming\nvm\v13.8.0\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:5:33)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\Mickell\AppData\Roaming\nvm\v13.8.0\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:169:25)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
Could not determine Node.js install directory
What am I doing wrong?
This happens when you run a newer version of npm with an older version of node. Make sure no old version of node is in your path.
I'm facing the following error message on Windows 10x64 for Java module while executing javascript code:
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'java'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (C:\Users\Rau\Desktop\Test.js:1:12)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)"
var java = require('java');
var javaLangSystem = java.import('java.lang.System');
The java module is not automatically available (i.e. it is not included with node.js ). It is available through the npm registry: https://www.npmjs.com/package/java
What this error is trying to tell you is it looked in all the paths for the java module and could not find it.
Make sure you have the java module installed via:
npm install java
I am using node.js to run one app given by my professor on my chrome. Something wrong happen, but I don't know because I am a rookie.
The structure is as follows:
/app
/models
answers.js
questions.js
sessions.js
user.js
passport.js
qmanage.js
routes.js
/config
auth.js
database.js
mcd.js
package.json
/public
some css png fonts jpg document
qloader.js
server.js
/views
some ejs document
At first, it shows this problem:
module.js:457
throw err;
^
Error: Cannot find module 'mongoose'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/shen/Desktop/os/cse303.p2/server.js:2:16)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
then, based on this help Node.js error Error: Cannot find module 'mongoose' I run npm install mongoose in my root path of project. Then I have those error below:
dyn143030:cse shen$ node server.js
{ Error: Cannot find module '../build/Release/bson'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/shen/Desktop/os/cse303.p2/node_modules/bson/ext/index.js:15:10)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3) code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
events.js:160
throw er; // Unhandled 'error' event
^
Error: Invalid mongodb uri. Missing hostname
at muri (/Users/shen/Desktop/os/cse303.p2/node_modules/muri/lib/index.js:40:11)
at NativeConnection.Connection.open (/Users/shen/Desktop/os/cse303.p2/node_modules/mongoose/lib/connection.js:195:16)
at Mongoose.connect (/Users/shen/Desktop/os/cse303.p2/node_modules/mongoose/lib/index.js:212:15)
at Object.<anonymous> (/Users/shen/Desktop/os/cse303.p2/server.js:4:10)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.runMain (module.js:590:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
I tried to find solution from this help
Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' } js-bson: Failed to load c++ bson extension, using pure JS version
but it seems not my case, because I am using OS X 10.11.3
dyn143030:cse shen$ node -v
v6.5.0
dyn143030:cse shen$ npm -v
3.10.3
From my aspect, I think the system find bson someplace wrong, so how to modify it? Thanks! If any more information is need, please tell me.
I find in node_modules\bson\ext\index.js
and change path on 10th line
bson = require('../build/Release/bson'); to bson = require('bson');
You can try adding mongoose to the dependency list in the package.json file, or also doing >npm install mongoose in the project folder.
I get this error when launching iron-node
buster-test run failed: Error: -c/--config: Error loading configuration /Users/r01010010/Projects/Mad/paysite/test/buster.js
Cannot find module '../build/Debug/addon'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:289:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/Users/r01010010/Projects/Mad/paysite/node_modules/heapdump/lib/main.js:18:15)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
No idea on how to solve this.
Env: Node.js v0.10.40 with nvm, node-gyp v3.2.1
With iron-node you do not need this Module. You can read and write such things within dev-tools-window in the Profiles tab. There ist also this document which provides more details. https://github.com/s-a/iron-node/blob/master/docs/PROFILE.md