Cannot install packages using node package manager in Ubuntu

TL;DR: sudo apt-get install nodejs-legacy First of all let me clarify the situation a bit. In summer 2012 Debian maintainers decided to rename Node.js executable to prevent some kind of namespace collision with another package. It was very hard decision for Debian Technical Committee, because it breaks backward compatibility. The following is a quote from … Read more

How can I use an ES6 import in Node.js? [duplicate]

Node.js has included experimental support for ES6 support. Read more about here: https://nodejs.org/docs/latest-v13.x/api/esm.html#esm_enabling. TLDR; Node.js >= v13 It’s very simple in Node.js 13 and above. You need to either: Save the file with .mjs extension, or Add { “type”: “module” } in the nearest package.json. You only need to do one of the above to … Read more

How can I specify the required Node.js version in package.json?

You can set the engines field in your package.json and set requirements for either node or npm versions or both: “engines” : { “npm” : “>=7.0.0”, “node” : “>=16.0.0” } To enforce this via npm you need to create an .npmrc file (and commit it to the repository) and set the engines-strict option to true, … Read more

ExpressJS How to structure an application?

OK, it’s been a while and this is a popular question, so I’ve gone ahead and created a scaffolding github repository with JavaScript code and a long README about how I like to structure a medium-sized express.js application. focusaurus/express_code_structure is the repo with the latest code for this. Pull requests welcome. Here’s a snapshot of … Read more

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