Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Unable to create artifactError: EPERM: operation not permitted, unlink error #128

Closed
AbhishekMishraIH opened this issue Oct 8, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@AbhishekMishraIH
Copy link

Describe the bug
I have new repo with only 2 new classes. One is main apex class and another one is test class. On "sfp build -v" command i am getting
'Unable to create artifactError: EPERM: operation not permitted, unlink error' error.

To Reproduce

  1. Have new project with 2 class. one is main apex class and another is related test class.
  2. Run "sfp build -v" command
  3. You will face issue.

Expected behavior
Process should completed without any error on SFP Build command

Screenshots
image (37)

Platform Details (please complete the following information):

  • OS: Window 11
  • Version 39.2.2
  • Salesforce CLI(sfdx cli) Version: @salesforce/cli/2.60.13
  • CI Platform: locally

Additional context
Add any other context about the problem here.

@azlam-abdulsalam
Copy link

@AbhishekMishraIH please confirm the node version on your system, you can run node -v

@azlam-abdulsalam azlam-abdulsalam added bug Something isn't working and removed analysis labels Oct 8, 2024
@AbhishekMishraIH
Copy link
Author

@AbhishekMishraIH please confirm the node version on your system, you can run node -v

It's v20.17.0

@azlam-abdulsalam azlam-abdulsalam self-assigned this Oct 10, 2024
@dinhphieu
Copy link

dinhphieu commented Oct 23, 2024

@azlam-abdulsalam

Same issue on:

  • Windows 10
  • Node 20.x
  • sfp 39.2.3

When printing out the exception stacktrace at src/core/artifacts/generators/ArtifactGenerator.ts:89, I can see that it's coming out from rimraf:

Error: EPERM: operation not permitted, unlink 'C:\Users\PDINH\OneDrive\dev\CRMSalesforce\.sfpowerscripts\ujYeS_source\src\core-crm\globalValueSets\ConstructeurEditeur.globalValueSet-meta.xml'
    at unlinkSync (node:fs:1868:18)
    at C:\Users\PDINH\OneDrive\dev\sfp\node_modules\.pnpm\r[email protected]\node_modules\rimraf\src\fix-eperm.ts:31:12
    at method (C:\Users\PDINH\OneDrive\dev\sfp\node_modules\.pnpm\r[email protected]\node_modules\rimraf\src\retry-busy.ts:56:16)
    at C:\Users\PDINH\OneDrive\dev\sfp\node_modules\.pnpm\r[email protected]\node_modules\rimraf\src\rimraf-windows.ts:176:28
    at ignoreENOENTSync (C:\Users\PDINH\OneDrive\dev\sfp\node_modules\.pnpm\r[email protected]\node_modules\rimraf\src\ignore-enoent.ts:10:12)
    at rimrafWindowsDirSync (C:\Users\PDINH\OneDrive\dev\sfp\node_modules\.pnpm\r[email protected]\node_modules\rimraf\src\rimraf-windows.ts:176:21)
    at rimrafWindowsDirSync (C:\Users\PDINH\OneDrive\dev\sfp\node_modules\.pnpm\r[email protected]\node_modules\rimraf\src\rimraf-windows.ts:184:18)
    at rimrafWindowsDirSync (C:\Users\PDINH\OneDrive\dev\sfp\node_modules\.pnpm\r[email protected]\node_modules\rimraf\src\rimraf-windows.ts:184:18)
    at rimrafWindowsDirSync (C:\Users\PDINH\OneDrive\dev\sfp\node_modules\.pnpm\r[email protected]\node_modules\rimraf\src\rimraf-windows.ts:184:18)
    at rimrafWindowsDirSync (C:\Users\PDINH\OneDrive\dev\sfp\node_modules\.pnpm\r[email protected]\node_modules\rimraf\src\rimraf-windows.ts:184:18)

I tried bumping rimraf from ^5.0.1 to ^6.0.1 in package.json but still no luck

There's also a closed related issue in rimraf's repo, which doesn't help much though: isaacs/rimraf#156

UPDATE: PR #134 should fix it

@azlam-abdulsalam
Copy link

Thanks @dinhphieu , the changes proposed has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants