..."test": "mocha ..."...
npx mocha ...
One of my pet-peeves is when a package is globally installed when it should be a devDependencies within a project. For example, if you use the TypeScript compiler in a project, "typescript" is a "devDependency"; do not make installing it globally a requirement. This lets different projects depend on different versions of the typescript compiler. It also makes it so that somebody can download your project and run a build without having to install additional dependencies. This goes for gulp, etc.
I also forgot a few:
npm info express dist-tags
NPM greater than version 5 is pretty amazing. Earlier versions, not so much. I would recommend yarn if you are stuck with earlier versions of NPM.
Oh, and don't forget that an .npmrc file local to your project overrides a global .npmrc file: useful for CI servers (store a .npmrc file with your project)!
Good point on the project specific .npmrc.
Another tip is that a separate repository (and credentials) can be configured per scope as well (credit Guillaume Martigny for mentioning scoped modules first below).
This can be useful if you have some private modules in a private repository but do not wish to proxy all requests for public modules through it as well.
I also agree npm link is very useful if working on multiple modules and testing fixes.
We’re a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.