“npm config set registry https://registry.npmjs.org/” is not working in windows bat file

You shouldn’t change the npm registry using .bat files. Instead try to use modify the .npmrc file which is the configuration for npm. The correct command for changing registry is npm config set registry <registry url> you can find more information with npm help config command, also check for privileges when and if you are running .bat files this way.

node.js: how to use setInterval and clearInterval?

Using setInterval() What if you need to repeat the execution of your code block at specified intervals? For this, Node has methods called setInterval() and clearInterval(). The setInterval() function is very much like setTimeout(), using the same parameters such as the callback function, delay, and any optional arguments for passing to the callback function. A … Read more

First Heroku deploy failed `error code=H10`

Found solution for me here: Heroku + node.js error (Web process failed to bind to $PORT within 60 seconds of launch) In my case my app crashed because I was hard setting the PORT, instead of using the port that heroku dinamicaly sets, which can be accessed with process.env.PORT

Find the version of an installed npm package

npm list for local packages or npm list -g for globally installed packages. You can find the version of a specific package by passing its name as an argument. For example, npm list grunt will result in: Alternatively, you can just run npm list without passing a package name as an argument to see the versions of all your packages: You can … Read more

What Are “npm run dev” and “npm run prod”

They are indeed the scripts as defined in the package.json file as you discovered. The values are run by your shell (so, for example, bash, zsh, etc. on UNIX-like operating systems). One key thing to note is that the node_modules/.bin directory is added to PATH before executing. So, in the case of the two scripts you’re asking about, cross-env can be found in node_modules/.bin (because it’s almost … Read more

How to write a .nvmrc file which automatically change node version

As @Aditya-M-P has already mentioned you can run the following command inside your projects root directory to generate the .nvmrc to set a desired NodeJS version for you project to work properly: It will generate something like this inside your .nvmrc file: Also using 10.16.2 without the v letter will work just fine. However, in the official documentation in the .nvmrc section it never mentions … Read more

What does the “as” keyword do?

That is not vanilla JavaScript, it is TypeScript. As any means consider the typed object as a plain untyped JavaScrpt object. The as keyword is a Type Assertion in TypeScript which tells the compiler to consider the object as another type than the type the compiler infers the object to be.

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