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

前端 未结 15 657
隐瞒了意图╮
隐瞒了意图╮ 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-12 23:57

    Delete package-lock.json it works for me

    then npm install

    0 讨论(0)
  • 2020-12-12 23:57

    if your node_modules got installed in say /home/UserName/ like in my case, your package-lock.json file will also be there. just delete this file, go back to your app folder and run npm init and then npm install <pkgname> (e.g express) and a new node_modules folder will be created for your.

    0 讨论(0)
  • 2020-12-12 23:59

    If your folder already have package.json

    Then,

    Copy the path of package.json

    Open terminal

    Write:

    cd your_path_to_package.json

    Press ENTER

    Then Write:

    npm install

    This worked for me

    0 讨论(0)
  • 2020-12-13 00:04

    You need to make sure if package.json file exist in app folder. i run into same problem differently but solution would be same

    Run this command where "package.json" file exist. even i experience similar problem then i change the folder and got resolve it. for more explanation i run c:\selfPractice> npm start whereas my package.json resides in c:\selfPractice\frontend> then i change the folder and run c:\selfPractice\frontend> npm start and it got run

    0 讨论(0)
  • 2020-12-13 00:06

    If you already have package-lock.json file just delete it and try again.

    0 讨论(0)
  • 2020-12-13 00:07

    You can use npm init to create a package.json.

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