question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Executing `np --version` tries to execute typical np executiion

See original GitHub issue

Description

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

  1. 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:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sindresorhuscommented, Feb 17, 2021

This is an intentional feature in meow: https://github.com/sindresorhus/meow/issues/113

It’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. So np --yolo --version would be allowed, but np 1.2.3 --version would not. Still not sure it’s worth it though.

0reactions
sindresorhuscommented, Feb 17, 2021

Perhaps it would be a “feature” to meow in the future, but small use case at this point.

Feel free to open an issue on the meow repo.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found