Create package.json from package-lock.json

后端 未结 4 1360
星月不相逢
星月不相逢 2021-02-05 01:02

I downloaded a theme and it has a package-lock.json file but no package.json file. Is there a way I can generate the package.json from the package-lock.json file. How do I insta

4条回答
  •  面向向阳花
    2021-02-05 01:23

    package-lock.json file relies on the presence of a package.json file, So it's not possible to retrieve package.json (happy to be proved wrong).

    So a possible solution left is to use a module like auto-install which is capable of generating package.json from the project file dependencies.

    First, you need to install the module globally npm install -g auto-install. Then run npm init and answer the basic requirements.

    Then, run auto-install in your project root directory. All the dependencies should reflect in package.json file.

    **

    Or Install node modules directly from package-lock.json

    **

    Run npm ci which bypasses a package’s package.json to install modules from a package’s lockfile.

    More Information

提交回复
热议问题