Executing `np --version` tries to execute typical np executiion
See original GitHub issueDescription
When executing np --version
, it seems np
is trying to actually run within current directory
The following example executes np --version
in a directory which does not have .git initialized, when executing in a typical npm project, it has a different message
Steps to reproduce
- In any directory, use
np --version
Expected behavior
Show the current np
version information
Environment
np - 7.3.0 (trying to upgrade to 7.4.0) Node.js - 14.5.0 npm - 7.0.15 Git - 2.30.0 OS - macOS 10.15.7
$ np --version
✖ Could not infer the default Git branch. Please specify one with the --branch flag or with a np config.
or, from within a project which has a valid .git project
$ np --version
Publish a new version of @codedungeon/gunner (current: 0.21.1)
? No commits found since previous release, continue? (y/N)
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
standard-version - npm
Start using standard-version in your project by running `npm i ... prebump / postbump : executed before and after the version is bumped....
Read more >npm-ci
An easy way to do this is to run, for example, npm config set legacy-peer-deps=true --location=project and commit the . npmrc file to...
Read more >concurrently - npm
I like task automation with npm but the usual way to run multiple commands concurrently is npm run watch-js & npm run watch-css...
Read more >ts-node - npm
ts-node is a TypeScript execution engine and REPL for Node.js. It JIT transforms TypeScript into JavaScript, enabling you to directly execute ...
Read more >npm-exec
Run a command from a local or remote npm package. ... Select CLI Version: ... of the executed command, along with any locally...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is an intentional feature in
meow
: https://github.com/sindresorhus/meow/issues/113It’s to make it possible for the auto-help thing to work in CLIs based on
meow
that have subcommand.One way we could solve this is to allow
--version
, but only if there are no positional arguments. Sonp --yolo --version
would be allowed, butnp 1.2.3 --version
would not. Still not sure it’s worth it though.Feel free to open an issue on the
meow
repo.