np: Package publishing partially fails when running tasks
Hi!
Love this tool. It’s been giving me some weird results recently. I tried publishing a brand new version of a scoped package:

After running, it looked like it had succeeded, even though it sat frozen on the version published message. After some seconds, the errors appeared and the application finished. The package was not published to npm.
Here is the package.json that was used.
The tail end of the execution:

Versions:
$ node --version && npm --version
v8.7.0
5.4.2
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 12
- Comments: 48 (8 by maintainers)
Is anyone able to look into this? Would it be worth creating a new issue instead to look towards supporting local installation rather than global? I won’t want
npinstalled globally - I’d like it to be a part of the release process for every project. I usually document some command to run to either publish or deploy:npm run pub,npm run deployetc. - I wouldn’t expect anyone to have to install any global packages.EDIT: This issue also doesn’t seem to have anything to do with the Cleanup phase. Disabling that doesn’t fix the issue for me on any of my machines.
I can confirm this has been fixed in 2.16.1, thanks @mastilver.
@gonzofish This is the same thing that I’m experiencing. It definitely seems that the tasks carry on in the background, and crash later (as it seems the tests etc. start before the modules installations are completed).
This is reproducible for me every publish - so if there’s something I can try or information I can share, please let me know.
As I mention earlier, rxjs is ‘broken’, a quick fix would be to freeze the version, but in the end we need to understand what’s happening…
@SamVerschueren @sindresorhus Would you accept a PR that freeze
rxjsas a temporary fix?the issue is with
rxjs, I will try to find what the issue with itI’m also seeing this issue. Here are the symptoms:
execathat’s printed way afternp“succeeds”.For me this was due to how
npcleans thenode_modulesfolder.As currently written, you must install
npglobally.If you try to use it responsibly like you would for any other binary, you don’t install it globally. Instead, you add it in
devDependenciesand then reference it from there. The issue is that during the “Cleanup” phase I thinknpis removing itself, so everything after that doesn’t actually do anything (even though it says it succeeded).If I remove it from
devDependenciesand install it globally withnpm install --global np(even though I’m usingyarn) it works.This could be solved by making the cleanup phase smarter than just
del('node_modules')to avoid deleting itself instead, which would be nice because things shouldn’t require being installed globally.https://github.com/sindresorhus/any-observable tests are failing which is I think whynpisn’t workingEDIT: I think I was testing it the wrong way, will investigate more later
I’m having the same issue
Latest version is from the 7th of June and I’m pretty sure I published several modules between now and then so my first thought is that it must come from a dependency that introduced a breaking change
@perry-mitchell the version issue is being tracked https://github.com/sindresorhus/np/issues/203
@mastilver
Open a PR, and it will get merged pretty quickly. Make sure to reference this issue in the description.
Thanks. For me, it looked like that all npm exec command was not handled correctly and was not waiting the end of the command. I’ve tried to downgrade rxjs dependency to 5.4.3 and it works. Any 5.5 versions don’t work. I have a private registry so I will use it, waiting the fix upstream.
Same problem here.
after changing that version number from
oldtonew, it will still show the successful message asold ver publishedwill
tagbut won’tpublishsince always ends with error because of thepromiseissue which like above, I usejestthough