diff --git a/source/npm-util.js b/source/npm-util.js index 34cb59af..7e2f44f5 100644 --- a/source/npm-util.js +++ b/source/npm-util.js @@ -44,10 +44,16 @@ exports.collaborators = async packageName => { exports.prereleaseTags = async packageName => { ow(packageName, ow.string); - const stdout = await execa.stdout('npm', ['view', '--json', packageName, 'dist-tags']); - - const tags = Object.keys(JSON.parse(stdout)) - .filter(tag => tag !== 'latest'); + let tags = []; + try { + const {stdout} = await execa('npm', ['view', '--json', packageName, 'dist-tags']); + tags = Object.keys(JSON.parse(stdout)) + .filter(tag => tag !== 'latest'); + } catch (error) { + if (JSON.parse(error.stdout).code !== 'E404') { + throw error; + } + } if (tags.length === 0) { tags.push('next');