How can I debug my koa program with IDEA? - node.js

I need your help.
I can run my program but I can't use debug tool. When I click debug button it shows that there is something wrong. I can't figure it out. I use IDEA to debug my koa program.
If I need do something before debugging?
Debugger listening on ws://127.0.0.1:14967/66cdd084-feab-406a-924f-42d8d3c41141
For help, see: https://nodejs.org/en/docs/inspector
Error in JetBrains node debug connector: Error: spawnSync C:/Program Files/nodejs/node.exe ENOENT
at Object.spawnSync (internal/child_process.js:1041:20)
at spawnSync (child_process.js:616:24)
at execFileSync (child_process.js:643:15)
at Object.<anonymous> (C:\Users\dvdx\AppData\Local\Temp\debugConnector.202.6397.94.js:36:3)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at Module._preloadModules (internal/modules/cjs/loader.js:1298:12) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawnSync C:/Program Files/nodejs/node.exe',
path: 'C:/Program Files/nodejs/node.exe',
spawnargs: [
'C:\\Users\\dvdx\\AppData\\Local\\Temp\\debugConnector.202.6397.94.js'
],
error: [Circular],
status: null,
signal: null,
output: null,
pid: 0,
stdout: null,
stderr: null
}

Related

electrode-server throwing hapi webpack error

I am trying run this app locally using the below run command, and I am getting errors with starting the electrode server. I am rather new to this so please let me know what information is necessary in order to diagnose my issue. Thank you in advance for any help.
Relevant Dependencies
"#walmart/electrode-ccm-client": "3.3.1",
"#walmart/electrode-quimby-client": "2.0.2",
"#walmart/electrode-ui-config": "3.8.2",
"#walmart/electrode-wml-app": "3.3.5",
"electrode-archetype-react-app": "6.5.4",
"hapi": "^17.0.0",
- Dev -
"#walmart/electrode-build-utils": "^1.1.0",
"electrode-archetype-react-app-dev": "6.5.4",
"webpack-bundle-analyzer": "^3.7.0"
Run command:
NODE_TLS_REJECT_UNAUTHORIZED=0 clap dev
Terminal output:
Starting Electrode webpack dev server
electrode-server caught an error while starting your server
failed registering your plugin 'webpackDevHapi' with module '"./dev-hapi.js"' from path: 'CWD/node_modules/electrode-archetype-react-app-dev/lib/dev-admin'
message: Invalid plugin options {
"__name": "webpackDevHapi",
"module": "./dev-hapi.js",
"requireFromPath": "CWD/node_modules/electrode-archetype-react-app-dev/lib/dev-admin"
}
[1] "attributes" is required
Suggestion to resolve the issue:
Please double check and verify your plugin 'webpackDevHapi'.
If you have followed this resolution step and you are still seeing an
error, please file an issue on the electrode-server repository
git+https://github.com/electrode-io/electrode-server.git
Error: Invalid plugin options {
"__name": "webpackDevHapi",
"module": "./dev-hapi.js",
"requireFromPath": "CWD/node_modules/electrode-archetype-react-app-dev/lib/dev-admin"
}
[1] "attributes" is required
at Object.exports.assert (CWD/node_modules/electrode-server/node_modules/hoek/lib/index.js:740:11)
at Object.exports.apply (CWD/node_modules/electrode-server/node_modules/hapi/lib/schema.js:17:10)
at module.exports.internals.Server.internals.Plugin.register (CWD/node_modules/electrode-server/node_modules/hapi/lib/plugin.js:216:25)
at CWD/node_modules/electrode-server/lib/electrode-server.js:238:16
at CWD/node_modules/electrode-server/lib/electrode-server.js:237:29
From previous event:
at registerPlugins (CWD/node_modules/electrode-server/lib/electrode-server.js:234:20)
From previous event:
at startElectrodeServer (CWD/node_modules/electrode-server/lib/electrode-server.js:294:6)
at CWD/node_modules/electrode-server/lib/electrode-server.js:365:14
From previous event:
at start (CWD/node_modules/electrode-server/lib/electrode-server.js:354:71)
at processImmediate (internal/timers.js:464:21)
From previous event:
at electrodeServer (CWD/node_modules/electrode-server/lib/electrode-server.js:412:6)
at Object.<anonymous> (CWD/node_modules/electrode-archetype-react-app-dev/lib/dev-admin/dev-server.js:23:3)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
at internal/main/run_main_module.js:17:47
Unhandled rejection Error: Invalid plugin options {
"__name": "webpackDevHapi",
"module": "./dev-hapi.js",
"requireFromPath": "CWD/node_modules/electrode-archetype-react-app-dev/lib/dev-admin"
}
[1] "attributes" is required
at Object.exports.assert (CWD/node_modules/electrode-server/node_modules/hoek/lib/index.js:740:11)
at Object.exports.apply (CWD/node_modules/electrode-server/node_modules/hapi/lib/schema.js:17:10)
at module.exports.internals.Server.internals.Plugin.register (CWD/node_modules/electrode-server/node_modules/hapi/lib/plugin.js:216:25)
at CWD/node_modules/electrode-server/lib/electrode-server.js:238:16
at CWD/node_modules/electrode-server/lib/electrode-server.js:237:29
From previous event:
at registerPlugins (CWD/node_modules/electrode-server/lib/electrode-server.js:234:20)
From previous event:
at startElectrodeServer (CWD/node_modules/electrode-server/lib/electrode-server.js:294:6)
at CWD/node_modules/electrode-server/lib/electrode-server.js:365:14
From previous event:
at start (CWD/node_modules/electrode-server/lib/electrode-server.js:354:71)
at processImmediate (internal/timers.js:464:21)
From previous event:
at electrodeServer (CWD/node_modules/electrode-server/lib/electrode-server.js:412:6)
at Object.<anonymous> (CWD/node_modules/electrode-archetype-react-app-dev/lib/dev-admin/dev-server.js:23:3)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
at internal/main/run_main_module.js:17:47
Electrode webpack dev server exited code 0 - signal null

"Cannot find module 'libnpx'" error when npx mix command is run

I have recently started learning and attempting to use the npx mix commands but whenever I try to execute the command it returns this error:
node:internal/modules/cjs/loader:949
throw err;
^
Error: Cannot find module 'libnpx'
Require stack:
- /usr/share/npm/bin/npx-cli.js
at Module._resolveFilename (node:internal/modules/cjs/loader:946:15)
at Module._load (node:internal/modules/cjs/loader:787:27)
at Module.require (node:internal/modules/cjs/loader:1012:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/usr/share/npm/bin/npx-cli.js:3:13)
at Module._compile (node:internal/modules/cjs/loader:1112:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
at Module.load (node:internal/modules/cjs/loader:988:32)
at Module._load (node:internal/modules/cjs/loader:834:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/usr/share/npm/bin/npx-cli.js' ]
}
I am not sure how to fix this problem - any help with solving this would be greatly appreciated!

can you help? Error: Cannot find module 'react-dev-utils/WatchMissingNodeModulesPlugin'

Error: Cannot find module 'react-dev-utils/WatchMissingNodeModulesPlugin'
Require stack:
- C:\Users\stromboli\IdeaProjects\projects-ui\config\webpack.config.js
- C:\Users\stromboli\IdeaProjects\projects-ui\scripts\start.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1014:15)
at Function.Module._load (internal/modules/cjs/loader.js:884:27)
at Module.require (internal/modules/cjs/loader.js:1074:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (C:\Users\stromboli\IdeaProjects\projects-ui\config\webpack.config.js:18:39)
at Module._compile (internal/modules/cjs/loader.js:1185:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
at Module.load (internal/modules/cjs/loader.js:1034:32)
at Function.Module._load (internal/modules/cjs/loader.js:923:14)
at Module.require (internal/modules/cjs/loader.js:1074:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (C:\Users\stromboli\IdeaProjects\projects-ui\scripts\start.js:32:23)
at Module._compile (internal/modules/cjs/loader.js:1185:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
at Module.load (internal/modules/cjs/loader.js:1034:32)
at Function.Module._load (internal/modules/cjs/loader.js:923:14) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\stromboli\\IdeaProjects\\projects-ui\\config\\webpack.config.js',
'C:\\Users\\stromboli\\IdeaProjects\\projects-ui\\scripts\\start.js'
]
}
No matter what I do localhost won't open and I get this error. The github solutions shown didn't work either, how can I fix it I'm about to go crazy.
npm ls react-dev-utils
`-- react-dev-utils#12.0.1
In your config find webpack.config.dev.js and remove the following:
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
module.exports = {
// ...
plugins: [
// If you require a missing module and then `npm install` it, you still have
// to restart the development server for Webpack to discover it. This plugin
// makes the discovery automatic so you don't have to restart.
// See https://github.com/facebook/create-react-app/issues/186
new WatchMissingNodeModulesPlugin(paths.appNodeModules),
]
}

my npm refused to install and i entered "npm config unsafe-perm true" and now i receive this error when trying to install

node:fs:723
handleErrorFromBinding(ctx);
^
Error: EIO: i/o error, read
at Object.readSync (node:fs:723:3)
at tryReadSync (node:fs:433:20)
at Object.readFileSync (node:fs:471:19)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1120:18)
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)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (C:\Program Files\nodejs\node_modules\npm\lib\utils\exit-handler.js:4:22)
at Module._compile (node:internal/modules/cjs/loader:1103:14) {
errno: -4070,
syscall: 'read',
code: 'EIO'
}

Invoke the process.addListener() and Node tell me: No such module

I am newbie and I am writing a simple program based Node.js.
everything is fine until I added this line:
process.addListener('SIGINT', function(){ console.log( 'Sigint test.' ); } );
Run: Node sample.js
I got following message:
node.js:203
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: No such module
at EventEmitter.<anonymous> (node.js:361:27)
at Object.<anonymous> (D:\Nodejs\MySample\sample.js:13:9)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.<anonymous> (module.js:470:10)
at EventEmitter._tickCallback (node.js:195:26)
Environment:
Windows XP sp2
Node.js 0.5.9 for Windows
help me please...

Resources