Skip to content
Advertisement

Tag: node.js

NPM: request to https://registry.npmjs.org/corepack failed, reason: connect EHOSTUNREACH

NPM used to work no problem but now for some reason anything I try to do that involves connecting to the registry times out. The failure message I get from NPM is request to https://registry.npmjs.org/corepack failed, reason: connect EHOSTUNREACH 2606:4700::6810:1223:443 The command I’m running is npm update -g. I’m on Arch Linux, and I installed the NPM package from arch.

make mysql connection error in lambda, why?

I wonder difference to main, function environment nodejs 14.x mysql2 2.2.3 I made code, call pool.getconnection in main, it’s fine(success data from db) but can’t get a data from function. I wonder why this can’t get from function can’t find error log only find Promise pending.. Promise { } Answer The getConnection method does not return a Promise, you should

What is the NodeJS ES6 equivalent of let PouchDB = require(‘pouchdb’)?

I am trying to follow the tutorial at https://medium.com/beginners-guide-to-mobile-web-development/getting-started-with-pouchdb-f0f3d7baebab to use PouchDB inside of a server-side NodeJS script. and I’m getting stuck in Step 1: const PouchDB = require(‘pouchdb’); this results in: ReferenceError: require is not defined in ES module scope, you can use import instead When I google the error, I am told to change “type”:”module” to “type”:”commonjs”. Unfortunately,

Advertisement