What does the npm -S flag mean?

-S is shorthand for –save, and it adds the package you’re installing to the dependencies in your package.json file (which can be created with npm init). However, –save or -S is totally unnecessary if you’re using npm 5 or above since it’s done by default.

How to use a specific version of NPM?

Your NPM version is tied to your NodeJS version. As far as I can tell you can only have one NPM version per Node version. Using something like nodenv or, my favorite, asdf, you can define your node version per folder. Per Node version (e.g. per folder) you globally install the version of NPM that … Read more

How to list all the commands available in package.json?

You can use: npm run to list all commands. (Yarn also features similar functionality on yarn run.) This behavior is made explicit in the help page of npm help run: This runs an arbitrary command from a package’s “scripts” object. If no “command” is provided, it will list the available scripts. To get a quick … Read more

Vue js project not loading .env variables

From docs: Note that only NODE_ENV, BASE_URL, and variables that start with VUE_APP_ will be statically embedded into the client bundle with webpack.DefinePlugin. It is to avoid accidentally exposing a private key on the machine that could have the same name. So you need to add VUE_APP_ prefix to your variables.

Is there a way to specify angular version with the ng new command

It can be done by using npx command that downloads and runs the package without installing it. For example, npx @angular/cli@9 new my-project creates a new folder my-project in the current folder and puts a new project here using angular version 9. The local version of @angular/cli in this case will be the same as … Read more