diff options
author | laggingreflex <laggingreflex@gmail.com> | 2018-03-08 11:32:10 +0300 |
---|---|---|
committer | Kat Marchán <kzm@sykosomatic.org> | 2018-03-09 01:20:41 +0300 |
commit | c8230c9bbd596156a4a8cfe62f2370f81d22bd9f (patch) | |
tree | c4c065e1a4b5d47520c4ac80e9cba3a53734fd1a /bin | |
parent | fc8761daf1e8749481457973890fa516eb96a195 (diff) |
npx: fix npx prefix issue (#19608)
It was incorrectly calling `node npx-cli prefix` which led to downloading "prefix" package.
Instead it should be calling `node npm-cli prefix`
PR-URL: https://github.com/npm/npm/pull/19608
Credit: @laggingreflex
Reviewed-By: @zkat
Diffstat (limited to 'bin')
-rw-r--r-- | bin/npx | 5 | ||||
-rw-r--r-- | bin/npx.cmd | 3 |
2 files changed, 5 insertions, 3 deletions
@@ -12,18 +12,19 @@ if ! [ -x "$NODE_EXE" ]; then NODE_EXE=node fi +NPM_CLI_JS="$basedir/node_modules/npm/bin/npm-cli.js" NPX_CLI_JS="$basedir/node_modules/npm/bin/npx-cli.js" case `uname` in *MINGW*) - NPM_PREFIX=`"$NODE_EXE" "$NPX_CLI_JS" prefix -g` + NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g` NPM_PREFIX_NPX_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npx-cli.js" if [ -f "$NPM_PREFIX_NPX_CLI_JS" ]; then NPX_CLI_JS="$NPM_PREFIX_NPX_CLI_JS" fi ;; *CYGWIN*) - NPM_PREFIX=`"$NODE_EXE" "$NPX_CLI_JS" prefix -g` + NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g` NPM_PREFIX_NPX_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npx-cli.js" if [ -f "$NPM_PREFIX_NPX_CLI_JS" ]; then NPX_CLI_JS="$NPM_PREFIX_NPX_CLI_JS" diff --git a/bin/npx.cmd b/bin/npx.cmd index 72526178e..b79518ec5 100644 --- a/bin/npx.cmd +++ b/bin/npx.cmd @@ -8,8 +8,9 @@ IF NOT EXIST "%NODE_EXE%" ( SET "NODE_EXE=node"
)
+SET "NPM_CLI_JS=%~dp0\node_modules\npm\bin\npm-cli.js"
SET "NPX_CLI_JS=%~dp0\node_modules\npm\bin\npx-cli.js"
-FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPX_CLI_JS%" prefix -g') DO (
+FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_CLI_JS%" prefix -g') DO (
SET "NPM_PREFIX_NPX_CLI_JS=%%F\node_modules\npm\bin\npx-cli.js"
)
IF EXIST "%NPM_PREFIX_NPX_CLI_JS%" (
|