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
The <package-spec> parameter has no effect at all. Even a wrong path will not display an error and publish the current directory instead (ex: npm publish ./unknown-dir --dry-run).
Note
The pack command on the contrary is working as expected and ignores the workspace:
I had opened this issue, 2 years ago, that sounded similar at first, because npm publish <package-spec> was also not working as expected. But after looking at it again, it is the exact same problem, because I'm using cwd to navigate to a project and run the publish from there.
Expected Behavior
I would expect the command npm publish <package-spec> to publish what's located at the given path argument and not what's in the current directory.
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Considering the following mono-repo workspace:
When releasing a new project the idea is to:
cd projects/a
)dist
folder (ex:npm run build
)npm run release
which runsnpm publish ../../dist/a --access=public
)Issue
When specifying
workspaces
in the root package.json, the step 3 does not work as expected.It ignores the
<package-spec>
parameter completely and publish the files in the current directory instead:The
<package-spec>
parameter has no effect at all. Even a wrong path will not display an error and publish the current directory instead (ex:npm publish ./unknown-dir --dry-run
).Note
The
pack
command on the contrary is working as expected and ignores the workspace:Related
I had opened this issue, 2 years ago, that sounded similar at first, because
npm publish <package-spec>
was also not working as expected. But after looking at it again, it is the exact same problem, because I'm usingcwd
to navigate to a project and run the publish from there.Expected Behavior
I would expect the command
npm publish <package-spec>
to publish what's located at the given path argument and not what's in the current directory.Steps To Reproduce
git clone https://github.com/Badisi/issue-npm-publish-with-workspaces-2
npm install
cd projects/a
npm run release
Environment
The text was updated successfully, but these errors were encountered: