question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUILD ERROR EPERM: operation not permitted, unlink

See original GitHub issue

Type of Issue

[x ] Bug Report
[ ] Feature Request

Description

I set up 2 new Angular-Projects and set them up EXACTLY like in this tutorial: https://medium.com/@nikolasleblanc/building-an-angular-4-component-library-with-the-angular-cli-and-ng-packagr-53b2ade0701e . Every time i try to run the ng-packagr it fails and then there is the following error:

npm run forestrun

bte@0.0.0 forestrun C:\Users\Kevin.DeGoede\Documents\yoyo\bte ng-packagr -p ng-package.json

Building Angular Package Building entry point ‘bte’ Cleaning build directory Rendering Stylesheets Rendering Templates Compiling TypeScript sources through ngc Bundling to FESM15 Bundling to FESM5 Bundling to UMD Minifying UMD bundle Relocating source maps Copying staged files Writing package metadata Distributing npm packages with ‘dependencies’ is not recommended. Please consider adding @angular/animations to ‘peerDependencies’ or remove it from ‘dependencies’.

BUILD ERROR EPERM: operation not permitted, unlink ‘C:\Users\Kevin\Documents\yoyo\bte\dist\src\app\modules’ Error: EPERM: operation not permitted, unlink ‘C:\Users\Kevin\Documents\yoyo\bte\dist\src\app\modules’

npm ERR! code ELIFECYCLE npm ERR! errno 111 npm ERR! bte@0.0.0 forestrun: ng-packagr -p ng-package.json npm ERR! Exit status 111 npm ERR! npm ERR! Failed at the bte@0.0.0 forestrun script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Kevin\AppData\Roaming\npm-cache_logs\2018-05-04T08_30_30_818Z-debug.log

When trying again the following error will occur:

npm run forestrun

bte@0.0.0 forestrun C:\Users\Kevin\Documents\yoyo\bte ng-packagr -p ng-package.json

Building Angular Package glob error { Error: EPERM: operation not permitted, scandir ‘C:\Users\Kevin\Documents\yoyo\bte\dist\src\app\modules’ errno: -4048, code: ‘EPERM’, syscall: ‘scandir’, path: ‘C:\Users\Kevin\Documents\yoyo\bte\dist\src\app\modules’ }

BUILD ERROR EPERM: operation not permitted, scandir ‘C:\Users\Kevin\Documents\yoyo\bte\dist\src\app\modules’ Error: EPERM: operation not permitted, scandir ‘C:\Users\Kevin\Documents\yoyo\bte\dist\src\app\modules’

npm ERR! code ELIFECYCLE npm ERR! errno 111 npm ERR! bte@0.0.0 forestrun: ng-packagr -p ng-package.json npm ERR! Exit status 111 npm ERR! npm ERR! Failed at the bte@0.0.0 forestrun script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Kevin\AppData\Roaming\npm-cache_logs\2018-05-04T08_54_07_739Z-debug.log

When I try to access the dist/src folder with the system explorer I cant access it since I am not permitted to access it, although being logged in as the user it requests.

How To Reproduce

You can follow the tutorial https://medium.com/@nikolasleblanc/building-an-angular-4-component-library-with-the-angular-cli-and-ng-packagr-53b2ade0701e on Windows 10 with the Angular IDE.

I dont know whether there is something wrong with my OS or with the other software I am using. I tried it on another PC with another Windows 10 Build, but the error will still occur there. I also tested the same on a Mac and it worked fine.

Expected Behaviour

The behavior I expected was that packing the application works fine, just like on my Mac.

Version Information

Windows 10 Pro: 1709 Build 16299.371
Angular IDE: 17.0.0.c0000019t201804160508
ng-packagr: 2.4.2
@angular/*: 5.2.10
typescript: 2.5.3
rxjs: 5.5.10
node: 9.4.0
npm: 5.6.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

102reactions
jayoungerscommented, Jun 13, 2018

In case anyone else stumbles upon this for a similar reason:

I started getting this in angular-cli 6 when doing ng build my-lib --prod: I needed to add this to my tsconfig to resolve it:

“exclude”: [“dist”]

46reactions
mpscheidtcommented, Oct 10, 2018

@markwhitfeld In case you’ve installed the VSCode plugin “Angular Language Service”, try to deactivate it. It locks files and prevents ng-packagr from working correctly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: EPERM: operation not permitted, unlink 'D:\Sources ...
After cloning the project, change the properties of the folder and change the permissions of the user (give full access to the current...
Read more >
Error: EPERM: operation not permitted, unlink on npm install ...
This error is somewhat cryptic and for me it was occurring when a process was actively running. Closing running processes or perhaps just ......
Read more >
npm fails due to missing admin rights (operation not permitted ...
It happens randomly, and we can usually make the Pipeline pass anyway by rerunning it several times. It hasn't been an issue before...
Read more >
Error: EPERM: operation not permitted, unlink 'xxx.php'
The error told you that you have no permission to delete the files. Make sure the current user has read/write permissions to the...
Read more >
Error: EPERM: operation not permitted, unlink - Reddit
Error : EPERM: operation not permitted, unlink ... ... Does anyone know why this happens with serverless-webpack and serverless-plugin-typescript?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found