I had the error:
npm error npm ERR! code ELIFECYCLE
I followed the steps, which are described on geeksforgeeks.
- npm cache clean --force
- delete node_modules
- delete package-lock.json
- npm install
The node_modules are installed again, but package-lock.json doesen't appears again in the project directory. In the console I have the error:
npm ERR! code EPERM npm ERR! syscall rename npm ERR! path C:\xampp\htdocs\webshop_ts_mern\frontend\node_modules\react-scripts\package.json.4215348391 npm ERR! dest C:\xampp\htdocs\webshop_ts_mern\frontend\node_modules\react-scripts\package.json npm ERR! errno -4048 npm ERR! Error: EPERM: operation not permitted, rename 'C:\xampp\htdocs\webshop_ts_mern\frontend\node_modules\react-scripts\package.json.4215348391' -> 'C:\xampp\htdocs\webshop_ts_mern\frontend\node_modules\react-scripts\package.json' npm ERR! [OperationalError: EPERM: operation not permitted, rename 'C:\xampp\htdocs\webshop_ts_mern\frontend\node_modules\react-scripts\package.json.4215348391' -> 'C:\xampp\htdocs\webshop_ts_mern\frontend\node_modules\react-scripts\package.json'] { npm ERR! cause: [Error: EPERM: operation not permitted, rename 'C:\xampp\htdocs\webshop_ts_mern\frontend\node_modules\react-scripts\package.json.4215348391' -> 'C:\xampp\htdocs\webshop_ts_mern\frontend\node_modules\react-scripts\package.json'] { npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'rename', npm ERR! path: 'C:\xampp\htdocs\webshop_ts_mern\frontend\node_modules\react-scripts\package.json.4215348391', npm ERR! dest: 'C:\xampp\htdocs\webshop_ts_mern\frontend\node_modules\react-scripts\package.json' npm ERR! }, npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'rename', npm ERR! path: 'C:\xampp\htdocs\webshop_ts_mern\frontend\node_modules\react-scripts\package.json.4215348391', npm ERR! dest: 'C:\xampp\htdocs\webshop_ts_mern\frontend\node_modules\react-scripts\package.json',