Build Package.Json From Existing Node_Modules Folder?

后端 未结 3 710
青春惊慌失措
青春惊慌失措 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:33

    You could try to use shrinkwrap to nail down the dependencies from your existing node_modules folder.

    See https://docs.npmjs.com/cli/shrinkwrap

    It should create a npm-shrinkwrap with all versions nailed to the ones currently used in the node_modules folder with npm shrinkwrap.

    On the second system or in the second folder put the npm-shrinkwrap.json besides the package.json and try a npm install. In the optimal case it will recreate your modules exactly as in the existing location.

    If that does not help - can you post some more detailed error outputs?

提交回复
热议问题