Skip to content

Commit

Permalink
fix(publish): exception when publishing 1st ver
Browse files Browse the repository at this point in the history
When no versions are published, the lerna publish resulted the following exception:
```
lerna ERR! TypeError: Cannot read property '0.1.11' of undefined
lerna ERR!     at /home/circleci/project/node_modules/@lerna/publish/lib/get-unpublished-packages.js:20:31
lerna ERR!     at tryCatcher (/home/circleci/project/node_modules/bluebird/js/release/util.js:16:23)
lerna ERR!     at Promise._settlePromiseFromHandler (/home/circleci/project/node_modules/bluebird/js/release/promise.js:547:31)
```
  • Loading branch information
Roy Razon committed Mar 8, 2020
1 parent 6c4ee52 commit 4dab26b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion commands/publish/lib/get-unpublished-packages.js
Expand Up @@ -17,7 +17,7 @@ function getUnpublishedPackages(packageGraph, opts) {
const mapper = pkg =>
getPackument(pkg.name, opts).then(
packument => {
if (packument.versions[pkg.version] === undefined) {
if (packument.versions && packument.versions[pkg.version] === undefined) {
return pkg;
}
},
Expand Down

0 comments on commit 4dab26b

Please sign in to comment.