npm

dependencies#

https://docs.npmjs.com/files/package.json#dependencies

unsafe-perm#

I was having an issue building pixi.js and found it wasn’t running postinstall and was instead failing with;

npm WARN lifecycle pixi.js-monorepo@~postinstall: cannot run in wd pixi.js-monorepo@ npm run bootstrap (wd=/pixi.js)

This was due to running as root (inside a container), and the fix was to;

csharp
npm install --unsafe-perm

vscode on osx can't find node#

publishing npm packages to github#

In your .npmrc;

ruby
registry=https://registry.npmjs.org/ @staff0rd:registry=https://npm.pkg.github.com/ //npm.pkg.github.com/:_authToken=your_token

In your package.json;

json
"publishConfig": { "registry":"https://npm.pkg.github.com/" }

More information

check updates for packages#

shell
npx npm-check-updates

local npm registry#

Start verdaccio

bash
docker run -it -p 4873:4873 verdaccio/verdaccio

Login

bash
npm login --registry http://localhost:4873 --auth-type=legacy

Publish a package (from that package’s directory)

bash
npm publish --registry http://localhost:4873

Remove a package (from that package’s directory)

bash
npm unpublish --registry http://localhost:4873 --force

posts#