依赖在node-modules中有了,但package.json中没有

npm install xxxx 安装了依赖之后
我现在想同步后安装在node-modules中的依赖到package.json中,怎么解决啊

npm install xxxx --save 这样 xxx会自动保存再 package.json文件里

npm i -S xxxx , 安装的依赖会自动保存到package.json里。