Dependencies not displayed in package.json in Node.js

I am new to node.js. I know when I install a new module in node.js using npm install, it installs, but in package.json I can not find the package name in the dependencies. I know that I can print it, but it should appear when I install it using the command line that should appear. Here is my package.json file. `

{
  "name": "mapfeedback-test",
  "version": "1.0.0",
  "description": "Map feedback Javascript Test library 1.0",
  "main": "client.js",
  "bin": {
    "mapfeedback-test": "server.js"
  },
  "directories": {
    "doc": "docs"
  },
  "dependencies": {},
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node server.js"
  },
  "repository": {
    "type": "git",
    "url": "ssh://jasharma@gerrit.it.here.com:29418/CommunityPlatform/testing/mapfeedback-test"
  },
  "author": "",
  "license": "ISC",
  "keywords": [] }

I ask for advice and let me know if I am wrong.

I use the command npm installto install all packages but not showing up in dependencies.

`

+5
source share
6 answers

The quickest way to fix this:

npm install <dependencies listed here> --save

And that should add them to package.json

Update:

OP:

devDependencies dependencies

npm install <dependencies listed here> --save-dev


:

:

  • npm i <dependencies listed here> -S

< > DEV-:

  • npm i <dependencies listed here> -D

npm .

npm, , .

+8

npm, package.json , :

 npm install packagename --save
+5

npm install <pkg-name> --save

-   npm package.json

+3

Linux, , npm <pkgs list here> . :

npm i -S <pkgs list here>

-S pkgs dependencies: {... } package.json.

, -S npm , package.json

0

Linux Mac , sudo sudo npm install <dependencies listed here> --save

0

All Articles