Protractor Debugger cannot find module - javascript

I am running my test using protractor with async/await, and trying to use debugger. Entering in promt node --inspect-brk bin/protractor conf.js
Than open "chrome://inspect/#devices" in Chrome ("bin/protractor file:/// inspect" shows up), clicking "Inspect" and getting following error in promt:
Debugger listening on ws://127.0.0.1:9229/85c1f4a4-3048-4c73-b42f-61a5f078ba7e
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'C:\Users\harmatii\Protractor\calbar\bin\protractor'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Waiting for the debugger to disconnect...

Looks like the problem in the path for the protractor and conf.js.
Try to provide the correct path to the protractor and conf.js.
Should be something like this:
node --inspect-brk node_modules/protractor/bin/protractor /users/harmatii/Protractor/conf.js

Related

nest.js error when deploying start:prod to Digital Ocean App Platform

I have been trying to deploy my app to DO and I keep getting the error
Error: Cannot find module '/workspace/dist/main'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
at Function.Module._load (node:internal/modules/cjs/loader:841:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:22:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
So I have tried different variations in the package.json within the start:prod command but cant get it to build complete
/
/dist/main
../dist/main
Does anyone have any experience with getting this to work?
start:prod sounds like it should be set to node dist/src/main. This usually is the case when there is a file from outside of src being compiled with src, and Typescript is maintaining the directory structure in the output directory.

Cypress error infinite loading and console error also

When I open Cypress it gets in an infinite loading loop.
I also can see the following error on the promp:
√ Verified Cypress! C:\...\AppData\Local\Cypress\Cache\10.3.1\Cypress
Opening Cypress...
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module '"C:/.../AppData/Local/Cypress/Cache/10.3.1/Cypress/resources/app/node_modules/#packages/server/lib/plugins/child/register_ts_node.js"'
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 Module._preloadModules (internal/modules/cjs/loader.js:901:12)
at preloadModules (internal/bootstrap/node.js:601:7)
at startup (internal/bootstrap/node.js:273:9)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Also when I first open cypress it takes a lot of time, more than 3 minutes... but the first time it opens OK
npx cypress open
It looks like this is your first time using Cypress: 10.3.1
✔ Verified Cypress! C:\Users\...\AppData\Local\Cypress\Cache\10.3.1\Cypress
Opening Cypress...
+
after clicking on continue in this screen is when the error appears
Any solution?
Thanks in advance
SOLVED!!!
Solution founded.
I was usisng node v11 and it must be version 14... Sorry

Problems with cmd.exe and start.batch

So I am trying to start a discord bot but it won't allow me to acess the start.batch file, it just says this. I am currently learning so I dont exactly what it means
I've ran as administrator, not many things I just need some help
C:\WINDOWS\system32>node bot.js
internal/modules/cjs/loader.js:584
throw err;
^
Error: Cannot find module 'C:\WINDOWS\system32\bot.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
C:\WINDOWS\system32>pause
Press any key to continue . . .`enter code here`
I would just like for my bot to work and for it to start because this is the only thing that will allow me to get my bot online.
Thanks
You should change directory to the root folder where your bot.js is located.

Node.js are not running

Using macOs High Sierra, trying to run small node.js code node server.js, from iTerm, showing this error:
module.js:545
throw err;
^
Error: Cannot find module '/Users/vikasenkova/server.js'
at Function.Module._resolveFilename (module.js:543:15)
at Function.Module._load (module.js:470:25)
at Function.Module.runMain (module.js:690:10)
at startup (bootstrap_node.js:194:16)
at bootstrap_node.js:666:3
Cant't find solution here.. if somebody knows..Found this link https://gist.github.com/DanHerbert/9520689 when trying to delete files with this: rm -rf /usr/local/lib/node_modules showing that permission denied. Nothing helps.
Check if your running in the same directory as the server.js file. Also update your question with some code to get more specific answer. Hope it helps you.

Run node.js with different file extension

Is is possible to run node.js with a different extension than .js like: node server.type instead of node server.js?
I have tried require.extensions
require.extensions['.type'] = require.extensions['.js'];
but I get this error:
Error: /root/project/server.type: invalid ELF header
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
However I think this has nothing to do with require unless I want to require these files from within node.js.
Works just fine:
$ echo 'console.log("hello world")' > server.type
$ node server.type
hello world
But I'm guessing that you want to run it as an executable. In that case, start your script with:
#!/usr/bin/env node
# followed by your actual script:
console.log("hello world");
And make your script executable:
chmod 755 server.type
After that:
$ /root/project/server.type
hello world

Categories