asdf-vm / asdf-vm/asdf-nodejs

npx or similar commands not working as expected?

Open
#141 13 comments 12 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
989
Forks
162
PR merge metrics
No merged PRs in 30d

Description

Any tips on how to handle the below issues?

```
$> asdf --version
v0.7.4
$> asdf which npx
/Users/joshua/.asdf/installs/nodejs/11.10.1/.npm/bin/npx
$> npx

ERROR: You must supply a command.

Execute binaries from npm packages.

npx [options] [@version] [command-arg]...

npx [options] [-p|--package ]... [command-arg]...

npx [options] -c ''

npx --shell-auto-fallback [shell]

Options:
--package, -p Package to be installed. [string]
--cache Location of the npm cache. [string]
--always-spawn Always spawn a child process to execute the command.
[boolean]
--no-install Skip installation if a package is missing. [boolean]
--userconfig Path to user npmrc. [string]
--call, -c Execute string as if inside `npm run-script`. [string]
--shell, -s Shell to execute the command with, if any.
[string] [default: false]
--shell-auto-fallback Generate shell code to use npx as the "command not
found" fallback.
[string] [choices: "", "bash", "fish", "zsh"]
--ignore-existing Ignores existing binaries in $PATH, or in the local
project. This forces npx to do a temporary install and
use the latest version. [boolean]
--quiet, -q Suppress output from npx itself. Subcommands will not
be affected. [boolean]
--npm npm binary to use for internal operations.
[string] [default:
"/Users/joshua/.asdf/installs/nodejs/11.10.1/.npm/lib/node_modules/npx/node_mo
dules/npm/bin/npm-cli.js"]
--node-arg, -n Extra node argument when calling a node binary.[string]
--version, -v Show version number [boolean]
--help, -h Show help [boolean]

For the full documentation, see the manual page for npx(1).

$> npx create-react-app
asdf: No version set for command create-react-app
you might want to add one of the following in your .tool-versions file:

nodejs 8.3.0
nodejs 11.6.0
$> which npx
/Users/joshua/.asdf/shims/npx
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Use the reported `asdf --version`, `asdf which npx`, `npx`, and `npx create-react-app` commands as reproduction steps, comparing their results with `which npx`. Done means the commands resolve consistently under the selected Node.js version, with the required configuration or limitation clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, shell
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.