Make sure that you are in web app's directory. Current path can be checked via command pwd
in Linux and cd
in windows. Navigate to your web app directory if you are somewhere else. Check existence of package.json
by listing the content of the folder. ls
and dir
can be used for ubuntu and windows respectively for listing content. Commands for ubuntu are as below:
pwd
cd your-path/
ls
Now Initialize npm in your web app directory if package.json
is not already existing there.
npm init
This will ask some information like:
- name of the app,
- its version,
- description,
- entry point,
- test command,
- git repo,
- keywords,
- author and
- license (if any)
You can select default values by leaving the fields empty if you aren't sure or confused about any field. Combining this information as json, npm will create a file named package.json
Just run the desired command now after initialization of npm or if its already initialized:
npm install connect