np
np copied to clipboard
Not working / no interactive feedback
Description
I've been trying to run np
to deploy a package today, but for some reason I'm not getting any feedback.
When I run np
, it returns too fast and shows no output at all.
However if I run np --help
or np --version
the output is fine.
Steps to reproduce
The steps are simple, not sure about the environment / circumstances needed to display the same behavior as I'm seeing.
- Run
$ np
- See no feedback, and no console logs, the process finishes almost immediately.
- However running
np --help
ornp --version
has a correct output:
$ np --help
A better `npm publish`
Usage
$ np <version>
Version can be:
patch | minor | major | prepatch | preminor | premajor | prerelease | 1.2.3
Options
--any-branch Allow publishing from any branch
--branch Name of the release branch (default: master)
--no-cleanup Skips cleanup of node_modules
--no-tests Skips tests
--yolo Skips cleanup and testing
--no-publish Skips publishing
--preview Show tasks without actually executing them
--tag Publish under a given dist-tag
--no-yarn Don't use Yarn
--contents Subdirectory to publish
--no-release-draft Skips opening a GitHub release draft
--test-script Name of npm run script to run tests before publishing (default: test)
--no-2fa Don't enable 2FA on new packages (not recommended)
Examples
$ np
$ np patch
$ np 1.0.2
$ np 1.0.2-beta.3 --tag=beta
$ np 1.0.2-beta.3 --tag=beta --contents=dist
Expected behavior
Running np
, or np 1.2.3
etc should start the interactive flow to be able to create a NPM release. I've been able to get this behavior last time I've tried, about a month ago.
Environment
np - 6.5.0 / 7.0.0 (tried both versions) Node.js - 13.10.1 npm - 6.13.7 Git - 2.11.0.windows.3 OS - Windows 10, version 2004, build 19041.572 CLI - Git bash
// @bunysae
@tmilar
This behavior can occur, when stdin is not properly connected to your terminal.
Unfortunately i can't reproduce this issue on my windows machine, so i made the repo np_debug with debugging statements.
Could you clone it, try to publish your package with it and post the output np
gives you:
git clone https://github.com/bunysae/np_debug
cd np_debug
npm link
cd <your_package>
np
Thanks for helping us resolving the issue.
Hi @bunysae , I've followed your steps. Firstly, npm link
was failing with this error:
$ npm link
npm WARN [email protected] requires a peer of webpack@>=1.11.0 but none is installed. You must install peer dependencies yourself.
audited 1142 packages in 10.041s
104 packages are looking for funding
run `npm fund` for details
found 1 low severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
npm ERR! code EEXIST
npm ERR! path C:\Program Files\nodejs\node_modules\np\source\cli.js
npm ERR! dest C:\Program Files\nodejs\np.cmd
npm ERR! EEXIST: file already exists, cmd shim 'C:\Program Files\nodejs\node_modules\np\source\cli.js' -> 'C:\Program Files\nodejs\np.cmd'
npm ERR! File exists: C:\Program Files\nodejs\np.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Tomas\AppData\Roaming\npm-cache\_logs\2020-11-07T18_05_33_453Z-debug.log
But uninstalling my existing np version fixed the issue npm uninstall -g np
After this, I've tried to execute again np
on my project, but it's still failing (no output / logs at all).
And simialrly as my original report, np --version
still has output, and also running np
on a different path also has the output:
× No `package.json` found. Make sure the current directory is a valid package.
Finally, tried running your np_debug
version explicitly:
$ cd ../np_debug
$ node source/cli.js
But still no output.
Closing due to age and unreproducibility