Sergey Kaunov
Sergey Kaunov

Reputation: 190

How to run a npm package in CLI?

I want to use json2csv inUbuntu, but can't figure out how do I call it. Sorry it's my first use of npm. =(

I installed npm from repo, then installed json2csv like they recommended, and I confused what to do to make it legit command for my system, or how to call it using path. =(

Upvotes: 0

Views: 821

Answers (1)

Sam Mikes
Sam Mikes

Reputation: 10818

To get the json2csv command in your PATH, you need to install the package globally:

npm install -g json2csv

Now you should be able to use json2csv as a command.

If that doesn't work, you need to ensure that the bin directory that npm is installing to is in your PATH:

PATH=${PATH}:$(npm get prefix)/bin

If that doesn't work, follow up here.

Upvotes: 2

Related Questions