You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading to v8.0.2, an error occurs when running the publish step with the --preview option:
> np --preview
✔ Prerequisite check
✔ Git
✔ Installing dependencies using npm
✔ Running tests using npm
↓ Bumping version using npm [skipped]
→ [Preview] Command not executed: npm version 1.8.0.
✖ Publishing package using npm
→ publish.getPackagePublishArguments is not a function
Pushing tags
Creating release draft on GitHub
✖ TypeError: publish.getPackagePublishArguments is not a function
at Task.skip (file:///.../node_modules/np/source/index.js:222:28)
Unfortunately I don't have a minimal repo that reproduces the issue, but I took a look at the code and I think the cause of the error is clear:
Prior to v8.0.0, getPackagePublishArguments was exported as part of the default export from the publish module.
This was changed in Move to ESM, update dependencies #683. getPackagePublishArguments is now exported as a named export, it won't be available with the default import (i.e. import publish from './npm/publish.js';).
I suspect that changing the import to something like import publish, { getPackagePublishArguments } from './npm/publish.js'; would fix the error.
Description
After upgrading to v8.0.2, an error occurs when running the publish step with the
--preview
option:Unfortunately I don't have a minimal repo that reproduces the issue, but I took a look at the code and I think the cause of the error is clear:
getPackagePublishArguments
was exported as part of the default export from the publish module.getPackagePublishArguments
is now exported as a named export, it won't be available with the default import (i.e.import publish from './npm/publish.js';
).import publish, { getPackagePublishArguments } from './npm/publish.js';
would fix the error.Environment
np - 8.0.2
Node.js - 18.16.0
npm - 9.5.1
Git - 2.39.0
OS - macOS 13.3.1
The text was updated successfully, but these errors were encountered: