nodemon not found in npm

You can resolve this problem by adding nodemon to your package.json: The problem happens when nodemon does not exist in /node_modules/.bin. Added –save-dev since it’s required during development only.

Node.js – SyntaxError: Unexpected token import

Node 13+ Since Node 13, you can use either the .mjs extension, or set {“type”: “module”} in your package.json. You don’t need to use the –experimental-modules flag. Modules is now marked as stable in node.js Node 12 Since Node 12, you can use either the .mjs extension, or set “type”: “module” in your package.json. And you need to run node with the –experimental-modules flag. Node 9 In Node 9, it is enabled behind a flag, and … Read more

Mongoose: findOneAndUpdate doesn’t return updated document

Why this happens? The default is to return the original, unaltered document. If you want the new, updated document to be returned you have to pass an additional argument: an object with the new property set to true. From the mongoose docs: Query#findOneAndUpdate Available options new: bool – if true, return the modified document rather than the original. defaults to false (changed in 4.0) Solution Pass {new: true} if you … Read more

SyntaxError: Unexpected token import – Express

NodeJS supports import natively only experimentally, and only if your script has the .mjs extension. That’s why the start in your package.json is referring to babel-node, which transpiles ES6 code into classic JS on-the-fly before running it. But I doubt even that command will work, because you’re not passing any presets to babel to run the script. Try this command: nodemon … Read more

nodemon not found in npm

You can resolve this problem by adding nodemon to your package.json: The problem happens when nodemon does not exist in /node_modules/.bin. Added –save-dev since it’s required during development only.

npm install not working in windows

After countless hours of debugging and researching, I decided to install in a different machine to see if the problem was with my Node installation. It worked. So for everyone who may come across this, know that the possibility to uninstall node and delete NPM will be there. This is what I did. I believe … Read more

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