Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

Puzzling output: "npx: installed 1 in 1.419s" #148

Closed
denishowe opened this issue Jan 13, 2018 · 16 comments
Closed

Puzzling output: "npx: installed 1 in 1.419s" #148

denishowe opened this issue Jan 13, 2018 · 16 comments

Comments

@denishowe
Copy link

Whenever I run npx it always says it "installed 1", even when I'm just asking it for help:

C:>npx -h
npx: installed 1 in 1.419s
The "path" argument must be of type string
Execute binaries from npm packages.
...

Installed 1 what? Why?

The next message it outputs 'The "path" argument must be of type string' is also completely spurious as I understand it.

It would be great to get rid of this confusing output or say what's really going on.

Windows 7 command prompt, node: v9.4.0, npx: 9.7.1.

Cheers

@laggingreflex
Copy link

laggingreflex commented Jan 15, 2018

Recently started using npx and was wondering the same thing.

Is it because it might be installing (or trying to install) dependencies even though they're already installed? If that's the case I would like to disable this. (I know it's a feature of npx to download/install dependencies on the fly, but I don't need it and I'm worried it would cause delay where internet speed/ping isn't ideal.)

Edit: never mind, there's already --no-install switch.

Edit2: However npx -h --no-install still outputs "installed 1 in xxx" message

@laggingreflex
Copy link

laggingreflex commented Jan 15, 2018

It seems to be installing a "prefix" package. It runs (in npm/bin/npx.cmd) CALL "%NODE_EXE%" "%NPX_CLI_JS%" prefix -g which is ≈ node npx.js prefix -g so npx tries to install prefix.

Not sure why. Is prefix a command in Mac/*nix?

Edit: I think command is meant to be npm prefix

@styfle
Copy link

styfle commented Jan 15, 2018

This sounds like a duplicate of #144

@denishowe
Copy link
Author

@styfle You're right.

@artulito
Copy link

I found that this issue can be fixed by rearranging your path:
Put your npm folder before the node installation folder. Example:

C:\Users\Arif\AppData\Roaming\npm;C:\Program Files\nodejs\

@hendrics
Copy link

@artulito where did you do this? which env/windows variable? is it different for GitBash vs command line vs power shell?

@artulito
Copy link

artulito commented Jun 29, 2018

@hendrics on the system env variables editor, to access it quickly, type 'env' in your start menu.

This will work globally.

Also, I think this issue is fixed already. Just upgrade to the latest node version.

@Neutrino-Sunset
Copy link

Rearranging the path didn't fix it for me.

@silkfire
Copy link

silkfire commented Aug 5, 2018

@zkat Any update on this? The paths are in different categories, NPM is bound to my user, whereas NodeJS is bound to the machine, so the order is not relevant in this case (I assume local runs before global anyway).

@benpolinsky
Copy link

@artulito Upgrading does not fix the problem.

@Darkle
Copy link

Darkle commented Aug 8, 2018

@zkat @artulito What does typing where npx in the terminal give you?
This is my output:

$ where npx
C:\Users\Coop\AppData\Roaming\npm\npx
C:\Users\Coop\AppData\Roaming\npm\npx.cmd
C:\Program Files\nodejs\npx
C:\Program Files\nodejs\npx.cmd

@DomDumont
Copy link

Rearranging the path DID fix it for me. Thanks

@artulito
Copy link

@Darkle This is mine

λ node --version                          
v10.5.0 

λ npx --version                           
6.1.0                                                
                                          
λ npm --version                           
6.1.0                                     
                                          
λ where npm                               
C:\Users\Arif\AppData\Roaming\npm\npm     
C:\Users\Arif\AppData\Roaming\npm\npm.cmd 
C:\Program Files\nodejs\npm               
C:\Program Files\nodejs\npm.cmd   

λ where npx                               
C:\Users\Arif\AppData\Roaming\npm\npx     
C:\Users\Arif\AppData\Roaming\npm\npx.cmd 
C:\Program Files\nodejs\npx               
C:\Program Files\nodejs\npx.cmd           

@artulito
Copy link

@silkfire the order is absolutely relevant. In windows, the global/system paths runs before the local/user paths. In which case, by rearranging the paths, I'm using my local version of npm & npx, which fixed this issue for me.

@jamessouth
Copy link

rearranging my PATH per @artulito and restarting fixed this for me.

@jbsulli
Copy link

jbsulli commented Sep 20, 2018

I'm using NVM for Windows so I had to rearrange %NVM_HOME% and %NVM_SYMLINK% so that %NVM_HOME% was after %NVM_SYMLINK%. I am not sure if this messes up NVM but it seems to have fixed npx 😛

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests