Build Package.Json From Existing Node_Modules Folder?

后端 未结 3 702
青春惊慌失措
青春惊慌失措 2020-12-11 09:45

I have a node_modules folder that works, and I have tried many permutations of package.json\'s that should create identical results and create extremely close results, but m

3条回答
  •  旧巷少年郎
    2020-12-11 10:45

    You can create the package.json file in your chosen location by running:

    npm init
    
    • You can answer the questions being asked when npm init is running or you can press enter until all the question are finished and update the questions at another time in the created package.json.
    • After the package.json file is created, create a script as suggested here.

    After creating the script run

    node script.js
    
    • Copy the dependencies listed in the terminal into the "dependencies": {} section of the package.json file you just created.
    • Done.

提交回复
热议问题