vue-lib-template icon indicating copy to clipboard operation
vue-lib-template copied to clipboard

Error in publishing lib as an npm package

Open peoray opened this issue 2 years ago • 2 comments
trafficstars

Hi @LinusBorg, thanks for the library.

I'm trying to publish the lib folder as an npm directory.

what I did was to cd into the /packages/lib folder and then run npm publish from there. I got this error: npm ERR! Cannot set properties of null (setting 'peer')

What could be the issue? I have reinstalled node_modules but that didn't help

peoray avatar Oct 05 '23 10:10 peoray

I haven't come across that error before, don't really have an idea what could be causing it. My first instinct would be to check that your versions of node, npm etc are uptodate. also consider that this repo runs on pnpm, so if you also use pnpm to manage your repo, try using pnpm publish (which should also work from the project root).

LinusBorg avatar Nov 11 '23 10:11 LinusBorg

Hi guys, couple of ideas:

  • If this is a public package and you don't pay an npm subscription, the first time you publish a package you need to run npm publish --access public
  • if you are publishing a scoped package @scope/package you need to be an admin of that "scope". Your user account or a company account you have made will give you a scope name. Check that you own it and have access.

epreston avatar Nov 14 '23 17:11 epreston