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.
Related
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
I've been trying to transfer a node program I created locally to an EC2 server via Cloud9, and I have already manually replaced all of the (req,res) => {} statements because it didn't accept that. However, now it's giving me
console.log(`foo ${bar}`)
^
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:439:25)
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)
at startup (node.js:119:16)
at node.js:945:3
It works fine on my local server and it runs fine here too, even without nodejs.
var bar = "bar"
console.log(`foo ${bar}`)
The version of node is v13.9.0 and it was installed via nvp.
Anyone know why this is happening? I really don't want to go through and convert all the strings with `
Thanks for the help, I figured out that cloud9 automatically installs nodejs, just not the right version. It installs 10.19.0, while the current latest version is 13.10.0. I installed the latest version, but the default was still 10.19.0. For anyone else having this problem, do
nvm ls
to list your installed node versions, then use
nvm alias default 13.10.0 (replace with whatever version you want)
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
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.
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