Errors from react-native-navigation on windows lstat - react-native-navigation

Error: EPERM: operation not permitted, lstat 'C:\Users\XXX\IdeaProjects\YYYY\node_modules\react-native-navigation\lib\android\app\build\intermediates\incremental\packageReactNative63DebugResources\merged.dir\values\values.xml'
Who is supposed to create values.xml?

Related

nodejs will not enable corepack: operation not permitted

I have installed nodejs and i am trying to enable corepack with corepack enable but it gives me this error on windows:
Internal Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\pnpm'
Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\pnpm'
I can not find the pnpm folder is is refering to in the nodejs folder and i have tried to npm install -g pnpm which did install pnpm
how do I fix this?
Try running the cmd as administrator

npm install fails on jenkins due to file locking

I have a powershell build script that runs npm install at some point.
I looked into the issue around the net, but I couldn't find anything helpful. I saw that somebody recommended putting an exception in Windows Defender for the jenkins folder because it was locking files. I did that, still no luck.
I don't think there are any locks on my part from the script, I'm just running npm install.
The strange thing is that this doesn't always happen, sometimes it works, sometimes it doesn't.
26610 verbose stack Error: EPERM: operation not permitted, unlink 'C:\Jenkins\workspace\...\node_modules\.staging\highcharts-705cfa89\highcharts.src.js'
26612 verbose Windows_NT 10.0.18363
26613 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
26614 verbose node v12.18.2
26615 verbose npm v6.14.5
26616 error code EPERM
26617 error syscall unlink
26618 error path C:\Jenkins\workspace\...\node_modules\.staging\highcharts-705cfa89\highcharts.src.js
26619 error errno -4048
26620 error Error: EPERM: operation not permitted, unlink 'C:\Jenkins\workspace\...\node_modules\.staging\highcharts-705cfa89\highcharts.src.js'
26620 error [OperationalError: EPERM: operation not permitted, unlink 'C:\Jenkins\workspace\...\node_modules\.staging\highcharts-705cfa89\highcharts.src.js'] {
26620 error cause: [Error: EPERM: operation not permitted, unlink 'C:\Jenkins\workspace\...\node_modules\.staging\highcharts-705cfa89\highcharts.src.js'] {
26620 error errno: -4048,
26620 error code: 'EPERM',
26620 error syscall: 'unlink',
26620 error path: 'C:\\Jenkins\\workspace\\...\\node_modules\\.staging\\highcharts-705cfa89\\highcharts.src.js'
26620 error },
26620 error errno: -4048,
26620 error code: 'EPERM',
26620 error syscall: 'unlink',
26620 error path: 'C:\\Jenkins\\workspace\\...\\node_modules\\.staging\\highcharts-705cfa89\\highcharts.src.js',
26620 error parent: 'react'
26620 error }
26621 error The operation was rejected by your operating system.
26621 error It's possible that the file was already in use (by a text editor or antivirus),
26621 error or that you lack permissions to access it.
26621 error
26621 error If you believe this might be a permissions issue, please double-check the
26621 error permissions of the file and its containing directories, or try running
26621 error the command again as root/Administrator.
26622 verbose exit [ -4048, true ]
Try yarn install instead of npm install
For anyone who runs into this issue
The package-lock.json was the issue. We have a proget feed for npm packages that we use, but the package-lock.json had the registry set to the default npm registry. This is what caused the issues.
The solution is either to delete the package-lock.json file or to commit it after you run npm install with the correct registry.

NPM error on running protractor tests (EPERM: operation not permitted)

I run in these error when trying to run protractor tests:
C:\nodejs\npm\node_modules\protractor\node_modules\q\q.js:155
throw e;
^
Error: EPERM: operation not permitted, scandir 'C:/$Recycle.Bin/S-1-5-18'
at Object.readdirSync (fs.js:886:3)
at GlobSync._readdir (C:\nodejs\npm\node_modules\protractor\node_modules\glob\sync.js:288:41)
at GlobSync._readdirInGlobStar (C:\nodejs\npm\node_modules\protractor\node_modules\glob\sync.js:267:20)
at GlobSync._readdir (C:\nodejs\npm\node_modules\protractor\node_modules\glob\sync.js:276:17)
at GlobSync._processGlobStar (C:\nodejs\npm\node_modules\protractor\node_modules\glob\sync.js:350:22)
at GlobSync._process (C:\nodejs\npm\node_modules\protractor\node_modules\glob\sync.js:130:10)
at GlobSync._processGlobStar (C:\nodejs\npm\node_modules\protractor\node_modules\glob\sync.js:383:10)
at GlobSync._process (C:\nodejs\npm\node_modules\protractor\node_modules\glob\sync.js:130:10)
at GlobSync._processGlobStar (C:\nodejs\npm\node_modules\protractor\node_modules\glob\sync.js:383:10)
at GlobSync._process (C:\nodejs\npm\node_modules\protractor\node_modules\glob\sync.js:130:10) {
errno: -4048,
syscall: 'scandir',
code: 'EPERM',
path: 'C:/$Recycle.Bin/S-1-5-18'
I tryed to reinstall protractor, nodejs, npm. I also tryed to clear npm cache and node_modules folders. Nothing changed :(
I've installed latest npm and nodejs version.
Could anyone could help me?

Error: EPERM: operation not permitted, unlink when running npm publish

When running npm publish I get the error
Error: EPERM: operation not permitted, unlink 'C:\Users\U173769\AppData\Local\Temp\npm-8604-f99ed410\tmp\fromDir-f7379123\package.tgz'
I am using Windows 10 and tried running as administrator, but I get the same error.
I'm using npm#6.4.1 and node#v10.15.3
You can probably use npm login or npm adduser.

Npm install angular/cli error EPERM Operation not permitted

4399 error Error: EPERM: operation not permitted, unlink
'C:\Users\deven\AppData\Roaming\npm\node_modules.staging\tmp-5fcc012e\README.md'
4399 error { Error: EPERM: operation not permitted, unlink
'C:\Users\deven\AppData\Roaming\npm\node_modules.staging\tmp-5fcc012e\README.md'
4399 error cause: 4399 error { Error: EPERM: operation not
permitted, unlink
'C:\Users\deven\AppData\Roaming\npm\node_modules.staging\tmp-5fcc012e\README.md'
4399 error errno: -4048, 4399 error code: 'EPERM', 4399
error syscall: 'unlink', 4399 error path:
'C:\Users\deven\AppData\Roaming\npm\node_modules\.staging\tmp-5fcc012e\README.md'
}, 4399 error stack: 'Error: EPERM: operation not permitted, unlink
\'C:\Users\deven\AppData\Roaming\npm\node_modules\.staging\tmp-5fcc012e\README.md\'',
4399 error errno: -4048, 4399 error code: 'EPERM', 4399 error
syscall: 'unlink', 4399 error path:
'C:\Users\deven\AppData\Roaming\npm\node_modules\.staging\tmp-5fcc012e\README.md',
4399 error parent: '#angular/cli' } 4400 error The operation was
rejected by your operating system. 4400 error It's possible that the
file was already in use (by a text editor or antivirus), 4400 error or
that you lack permissions to access it. 4400 error 4400 error If you
believe this might be a permissions issue, please double-check the
4400 error permissions of the file and its containing directories, or
try running 4400 error the command again as root/Administrator (though
this is not recommended). 4401 verbose exit [ -4048, true ]
Since you're using Windows, you have to launch the terminal as administrator and retry should work.
It seems like this is a problem with npm. Try deleting your node_modules folder and running npm install again. This should fix the problem.
It may be possible that your package.json is open in some editor. Close it and then run the npm command again.
Try to uninstall the CLI using:
npm uninstall -g #angular/cli
and reinstall using:
npm install -g #angular/cli
and also try to update npm to latest version
npm cache clean --force
npm install -g npm#latest
It solved for me when I made this: Right-click on -What ever program I use- and select Run as Administrator.
Personally I made it on PowerShell, but I assume that it works this way on any program
Launch your code editor (eg.. Visual Studio Code) as Administrator.
npm install -g #vue/cli.
vue create yourprojectname.
Please try following steps:
Delete node_modules
Do npm cache clean --force
Restart the PC
Try again npm install, now modules will install without any issues
(optional) - If you are behind VPN and not using any private registry , exit VPN and do npm install after restarting pc
I had opened the project in multiple terminals. Later after closing all the respective terminals and running 'npm i', things started to work well.

Resources