Is there a way to automatically build the package.json file for Node.js projects

后端 未结 10 912
梦毁少年i
梦毁少年i 2020-11-29 14:30

Is package.json supposed to be manually edited? Couldn\'t a program like npm just look through the files, see the \"require\" statements, and then use that to put the necess

10条回答
  •  再見小時候
    2020-11-29 15:01

    Based on Pylinux's answer, below is a solution for Windows OS,

    dir node_modules > abc.txt
    FOR /F %k in (abc.txt) DO npm install --save
    

    Hope it helps.

提交回复
热议问题