Penny
Penny

Reputation: 1280

How to solve: yaml2json command not found?

I wanted to install a command line tool to convert yaml files into json files. Actually My real intention is to validate yaml files all at once in a directory.

I did some research and followed the instructions listed here and here. However, command line always tells me that -bash: yaml2json: command not found. I'm wondering if it's because the files weren't in my path? my $PATH looks like this:

/Users/luca/.rbenv/shims:/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin:~/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

What should I do to get this work? Thank you very much!

Upvotes: 1

Views: 5544

Answers (2)

Ibrahim Albarki
Ibrahim Albarki

Reputation: 119

  • if you are using Ubuntu use the below command to install the required package:

    • sudo apt install libghc-yaml-dev
  • if you are using RHEL/CentOS use the below command to get the name of the package:

    • yum provides *bin/yaml2json
    • then install the package using sudo yum install <package-name>

Upvotes: 3

Penny
Penny

Reputation: 1280

It seems like sudo npm install-g yaml2json can solve the problem...But this yaml2json module can only work with one file at a time instead of files in a directory...

Plus when I run yaml2json ./_index.yaml, it returns "project_path" Not sure what it means and can't find the converted .json file either...

Upvotes: 0

Related Questions