getting error while executing npm install for cypress automation in windows---project taken from gitlab

Viewed 766
npm ERR! code 1
npm ERR! path C:\Users\JPawar\CYPRESS_AUTOMATION\page-un-article\node_modules\cypress
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node index.js --exec install
npm ERR! node:internal/modules/cjs/loader:936
npm ERR!   throw err;
npm ERR!   ^
npm ERR!
npm ERR! Error: Cannot find module 'strip-final-newline'
npm ERR! Require stack:
npm ERR! - C:\Users\JPawar\CYPRESS_AUTOMATION\page-un-article\node_modules\cypress\node_modules\execa\index.js
npm ERR! - C:\Users\JPawar\CYPRESS_AUTOMATION\page-un-article\node_modules\cypress\lib\util.js
npm ERR! - C:\Users\JPawar\CYPRESS_AUTOMATION\page-un-article\node_modules\cypress\index.js
npm ERR!     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:778:27)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:1005:19)
npm ERR!     at require (node:internal/modules/cjs/helpers:102:18)
npm ERR!     at Object.<anonymous> (C:\Users\JPawar\CYPRESS_AUTOMATION\page-un-article\node_modules\cypress\node_modules\execa\index.js:5:27)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1101:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:981:32)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:1005:19) {
npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR!   requireStack: [
npm ERR!     'C:\\Users\\JPawar\\CYPRESS_AUTOMATION\\page-un-article\\node_modules\\cypress\\node_modules\\execa\\index.js',
npm ERR!     'C:\\Users\\JPawar\\CYPRESS_AUTOMATION\\page-un-article\\node_modules\\cypress\\lib\\util.js',
npm ERR!     'C:\\Users\\JPawar\\CYPRESS_AUTOMATION\\page-un-article\\node_modules\\cypress\\index.js'
npm ERR!   ]
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\JPawar\AppData\Local\npm-cache\_logs\2022-01-08T07_20_10_984Z-debug.log
1 Answers

I did something and it work to me.

  1. go to C:\Users\username\node_modules with file explorer in windows.
  2. delete everything is here
  3. re run your install command. for example "npm i -D electron@latest"
Related