Creating json file inside a specific directory using terminal

10.6k views Asked by At

I'm trying to create my Starter Pack Setup and I need to install NPM dependencies. I should create a json file in: /Users/matteomattiussi/Documents/Udemy/Bootstrap/bs4projects/bs4starter but I don't know how do it because I always getting the json file in: /Users/matteomattiussi/package.json

Can someone help me, please?

2

There are 2 answers

0
marcell On

In order to create a package.json file in /Users/matteomattiussi/Documents/Udemy/Bootstrap/bs4projects/bs4starter (if the directory already exists and you have npm installed):

cd /Users/matteomattiussi/Documents/Udemy/Bootstrap/bs4projects/bs4starter
npm init

In using package.json:

This will initiate a command line questionnaire that will conclude with the creation of a package.json in the directory you initiated the command.

0
Henry On

You can use online JSON compiler and then download it in your directory. https://jsoneditoronline.org/ This is a example of a site which can create JSON file online.