Node.js getaddrinfo ENOTFOUND

In Node.js HTTP module’s documentation: http://nodejs.org/api/http.html#http_http_request_options_callback You can either call http.get(‘http://eternagame.wikia.com/wiki/EteRNA_Dictionary’, callback), the URL is then parsed with url.parse(); or call http.get(options, callback), where options is { host: ‘eternagame.wikia.com’, port: 8080, path: ‘/wiki/EteRNA_Dictionary’ } Update As stated in the comment by @EnchanterIO, the port field is also a separate option; and the protocol http:// shouldn’t … Read more

`npm install` fails on node-gyp rebuild with `gyp: No Xcode or CLT version detected!`

Even though you have them installed (my case), but by upgrading to Catalina (10.15.*) you can get this error (my case 🙂 ). Therefore, simply installing wouldn’t help as you will get an error that they are already installed. Therefore you need to hopefully just (I) reset the tool or in worse case (II) uninstall … Read more

node.js require() cache – possible to invalidate?

You can always safely delete an entry in require.cache without a problem, even when there are circular dependencies. Because when you delete, you just delete a reference to the cached module object, not the module object itself, the module object will not be GCed because in case of circular dependencies, there is still a object … Read more

Get all directories within directory nodejs

Promise import { readdir } from ‘fs/promises’ const getDirectories = async source => (await readdir(source, { withFileTypes: true })) .filter(dirent => dirent.isDirectory()) .map(dirent => dirent.name) Callback import { readdir } from ‘fs’ const getDirectories = (source, callback) => readdir(source, { withFileTypes: true }, (err, files) => { if (err) { callback(err) } else { callback( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)