npm ERR! Unable to authenticate, need: Basic realm=”Artifactory Realm”

Artifactory moved to support APIKEY only. If your old _auth was base64 encoding of username:password or username:encrypted_password then both are unacceptable now. You must use APIKEY in place of these. So, the supported _auth now becomes: _auth: APIKEY But ironically, even this didn’t work in some cases. Following seemed to be more reliable: You need … Read more

npm ERR! code ENOTEMPTY while npm install

I think the following command might be more appropriate: rm -r node_modules This will remove the node_modules folder in your repository. The command npm install should work now. If you are using Webpack, you can also remove the dist folder using rm -r dist and re-build your repository.

update the version in package.json without clean git working directory (without a task runner like Gulp)

From the npm version documentation at https://docs.npmjs.com/cli/version: If run in a git repo, it will also create a version commit and tag. This behavior is controlled by git-tag-version (see below), and can be disabled on the command line by running npm –no-git-tag-version version. It will fail if the working directory is not clean, unless the … Read more

Can I use npx with pnpm?

The are are two key uses of npx. Running executables inside your downloaded dependencies For example npx jest. The pnpm equivalent is pnpm exec jest. Running executable commands in packages you want to download transiently For example npx create-react-app my-app. The pnpm equivalent of this is pnpm dlx create-react-app my-app. Note: There used to be … Read more

How to fix Npm missing peer dependency

I have mis-understood the meaning of the ^ in version ^2.2.3. After reading this link, ^2.2.3 means >=2.2.3 <3.X. That’s why npm throws an warning. Besides, below are links about peer-dependencies What’s the difference between dependencies, devDependencies and peerDependencies in npm package.json file? https://nodejs.org/en/blog/npm/peer-dependencies/

How to install ESlint globally?

You can install Node modules within the project (locally) or globally. To switch to globally, you may use the -g flag, like so: npm install -g eslint Then see if it’s working without Sublime Text (-v flag to see the version of eslint): eslint -v To see where it was installed (assuming MacOS/Linux): which eslint … Read more

How to handle conflicting peer dependencies?

You are using npm 7.x, which is more strict about peer dependencies than npm 6.x. The easiest solution is to run npm install with the –legacy-peer-deps flag. In theory, that may result in some incompatibility issues with peer dependencies. In practice, a lot of people do it anyway. And a lot of people are running … Read more

tech