npm install doesn't create node_modules directory

后端 未结 8 1929
故里飘歌
故里飘歌 2020-12-05 13:07

I am trying to do a homework for a mongodb uni course. They gave us some files, instructions are:

run npm install mongodb then node app.js<

相关标签:
8条回答
  • 2020-12-05 13:45

    For node_modules you have to follow the below steps

    1) In Command prompt -> Goto your project directory.

    2) Command :npm init

    3) It asks you to set up your package.json file

    4) Command: npm install or npm update

    0 讨论(0)
  • 2020-12-05 13:50

    As soon as you have run npm init and you start installing npm packages it'll create the node_moduals folder after that first install

    e.g

    npm init

    (Asks you to set up your package.json file)

    npm install <package name here> --save-dev

    installs package & creates the node modules directory

    0 讨论(0)
提交回复
热议问题