Since enonic-npm-modules
is a monorepo, all packages should be published using Lerna. It's still possible to publish with npm
or yarn
, but it's not recommended.
Check if you are logged in to the npm from terminal:
npm whoami
...and login, if you haven't yet:
npm login
For more information read the documentation.
To publish packages with Lerna, you can just run the npm script:
npm run publish:all
Lerna will try to publish each package, that has changes since the last release, even if the README file is the only file that has changes. Unfortunately, it can't be avoided.
To use lerna commands directly, you may need to install it globally.
Here are the common steps for changing and publishing your code:
- Update something in the packages and commit your changes;
- Run
npm run publish:all
; - Proceed with the steps in the prompt.
Don't panic! Your problem may have a solution below.
If publishing failed on the last step and Lerna already updated package.json
, created commit with tags, you may want to fix the problem and try again:
lerna publish --force-publish $(ls packages/)
..or remove the tags and commit and start from scratch with two commands:
git tag -d $(git tag -l --points-at HEAD)
git reset --hard HEAD~1
Look at the official Lerna FAQ.