npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Nuwanst\package.json'

前端 未结 15 842
隐瞒了意图╮
隐瞒了意图╮ 2020-12-12 23:19

I just want to install socket.io to my project which is located on 3.chat folder. But when I run following command it shows following Warnings.And its not created a node_mod

15条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-13 00:19

    Have you created a package.json file? Maybe run this command first again.

    C:\Users\Nuwanst\Documents\NodeJS\3.chat>npm init

    It creates a package.json file in your folder.

    Then run,

    C:\Users\Nuwanst\Documents\NodeJS\3.chat>npm install socket.io --save

    The --save ensures your module is saved as a dependency in your package.json file.

    Let me know if this works.

提交回复
热议问题