npm package.json OS specific script

There’s an NPM package called run-script-os ( NPM | GitHub ) that doesn’t require you to write any additional files, and this can be convenient if what you’re trying to do is very simple. For example, in your package.json, you might have something like: “scripts”: { “test”: “run-script-os”, “test:darwin:linux”: “export NODE_ENV=test && mocha”, “test:win32”: “SET … Read more

Difference between tsconfig.json and tsconfig.app.json files in Angular

there is nothing that prevents you from getting rid of the tsconfig.app.json. it’s just an additional config file that allows you to adjust your configuration on an app basis. this is e.g. useful when you have multiple apps in the same angular-cli workspace. you could have the root folder with the tsconfig.json and then a … Read more

What is `”dev” true` in package-lock.json for?

So answering your first question, “dev”: true in package-lock.json means this dependency won’t be installed by npm install/npm ci when running in production mode. Having dependencies used only for local development environment marked with “dev”: true and then using –production in your CI might save you some build time. From documentation https://docs.npmjs.com/cli/install#description: By default, npm … Read more

What’s the difference between dependencies, devDependencies, and peerDependencies in NPM package.json file?

Summary of important behavior differences: dependencies are installed on both: npm install from a directory that contains package.json npm install $package on any other directory devDependencies are: also installed on npm install on a directory that contains package.json, unless you pass the –production flag (go upvote Gayan Charith’s answer), or if the NODE_ENV=production environment variable … Read more

Pass command line args to npm scripts in package.json

Short Answer: Essentially, what you’re wanting is to have an npm-script something like this, whereby <arg-here> is provide via the CLI; … “scripts”: { “my-build”: “npm run vumper <arg-here> && npm run format”, … }, … However, unfortunately npm does not have a built-in feature to achieve this. The special npm option –, (refer to … Read more

In VS Code, I’m getting this error, ‘Failed to load module. Attempted to load prettier from package.json’

This is a solution that worked for me 1. Install Prettier Globally via npm if you have never installed it globally npm i prettier -g 2. Search & Use the Prettier Path Extension Settings in your VS Code Settings // You can navigate to VS Code Settings > Extensions > Prettier for all Prettier Extension … Read more

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