The package-lock.json
of an existing project has been deleted for whatever reason.
Trying to recreate it gives the following error
$ npm i --package-lock-only
npm ERR! Cannot convert undefined or null to object
npm ERR! A complete log of this run can be found in: C:\Users\onthe\AppData\Local\npm-cache\_logs\2023-05-25T14_48_07_317Z-debug-0.log
In the log file I can see the following
2843 verbose stack TypeError: Cannot convert undefined or null to object
2843 verbose stack at Function.keys (<anonymous>)
2843 verbose stack at module.exports (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-pick-manifest\lib\index.js:213:22)
2843 verbose stack at RegistryFetcher.manifest (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\lib\registry.js:119:22)
2843 verbose stack at async Promise.all (index 10)
2843 verbose stack at async [buildDepStep] (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:1044:5)
2843 verbose stack at async Arborist.buildIdealTree (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:207:7)
2843 verbose stack at async Arborist.reify (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:159:5)
2843 verbose stack at async Install.exec (C:\Program Files\nodejs\node_modules\npm\lib\commands\install.js:147:5)
2843 verbose stack at async module.exports (C:\Program Files\nodejs\node_modules\npm\lib\cli.js:89:5)
$ node --version
v18.16.0
$ npm --version
9.6.5
The same error occurrs if I just do npm install