zkat / npx

execute npm package binaries (moved)

Home Page:https://github.com/npm/npx

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npx doesn't come along with npm@5.6.0?

lzl124631x opened this issue · comments

According to this article, I thought installing npm@5.2.0 will automatically install npx. I just installed npm@5.6.0 but npx is not installed, does it mean I have to run npm i -g npx? I hope npx come with npm by default.

It should have been installed. Try running npm i -g npm. If it still doesn't work, post the output of that command here.

I used nvm to install the latest version of node. Logs below. Maybe it's a problem of nvm? Not sure. But the log told me it installed npm@5.6.0.

C:\Richard\Project\archi\archi-backend>nvm install latest
Downloading node.js version 10.2.1 (64-bit)...
Complete
Creating C:\Users\ricl\AppData\Roaming\nvm\temp

Downloading npm version 5.6.0... Complete
Installing npm v5.6.0...

Installation complete. If you want to use this version, type

nvm use 10.2.1

C:\Richard\Project\archi\archi-backend>nvm list

    10.2.1
  * 8.9.4 (Currently using 64-bit executable)
    4.8.6

C:\Richard\Project\archi\archi-backend>nvm use 10.2.1
Now using node v10.2.1 (64-bit)

C:\Richard\Project\archi\archi-backend>nodemon
[nodemon] 1.14.12
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: C:\Richard\Project\archi\archi-backend\src/**/*
[nodemon] starting `npx ts-node ./src/app.ts`
'npx' is not recognized as an internal or external command,
operable program or batch file.
[nodemon] app crashed - waiting for file changes before starting..

Another weirdness:

C:\Richard\Project\archi\archi-backend>npm install axios -S
npm WARN npm npm does not support Node.js v10.2.1
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/

That second one is known and fixed in the latest version of npm. As I said before, try running npm i -g npm.

I guess it's a issue with the nvm / latest version of node.

@lzl124631x how did you fix this? I'm having the same problem. Using nvm-windows to manage node/npm versions and not getting npx bundled with the install...

I didn't try to fix. Just installed npx manually. I guessed there were some compatibility issue of nvm and latest node.