0

I had the error:

npm error npm ERR! code ELIFECYCLE

I followed the steps, which are described on geeksforgeeks.

  1. npm cache clean --force
  2. delete node_modules
  3. delete package-lock.json
  4. 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',

Roman
  • 137
  • 1
  • 14
  • 1
    1. It's package-lo**ck**, not lo**g**. 2. The output you show has errors with the installation. So, is the issue that package-lock.json is not there or that the installation doesn't work at all? 3. The errors seem like wrong permissions to the file system. – VLAZ Jan 13 '23 at 13:12
  • @VLAZ Thanks for your response. I try it again. – Roman Jan 13 '23 at 13:16
  • 1
    It could also be a permission issue, have you tried running the command prompt as Administrator? – node_modules Jan 13 '23 at 13:30
  • @node_modules. Done that, is is now installed. Thank you – Roman Jan 13 '23 at 14:00
  • 2
    Does this answer your question? [npm ERR! Error: EPERM: operation not permitted, rename](https://stackoverflow.com/questions/39293636/npm-err-error-eperm-operation-not-permitted-rename) – Emanuele Scarabattoli Jan 13 '23 at 14:41
  • 1
    @EmanueleScarabattoli It works with running the command prompt as Administrator. Thanks – Roman Jan 14 '23 at 10:34

0 Answers0