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
You can run npm init
in the same folder where node_modules is which will create a package.json followed by command prompts.
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?
You can create the package.json file in your chosen location by running:
npm init
After creating the script run
node script.js