ng build -aut locks ./dist folder
Running
$ ng build -aot
creates dist folder on Windows 10 with different rights than the actual user and deleting the dist folder is not possible
I get the error:
ENOTEMPTY: directory not empty, rmdir 'C:\angular\angulartest\dist'
Also deleting the folder manually fails
Only reboot of PC helps and I am now able to delete folder
Quite time consuming...
Node.js version: v8.1.2 NPM version: 5.0.3
Br. Jesper
We don't really do anything regarding permissions really. Are you perhaps running an administrator console, or did you install the npm packages with an administrator account?
There might be another process also creating a lock on that folder. You can use https://technet.microsoft.com/en-ca/sysinternals/bb896655.aspx to check out what process is holding that folder.
I hope this helps, but I don't think it's a bug with the CLI.
I have the same issue. Just installed the Angular IDE plugin for eclipse and from that terminal whenever I run npm run build:modules
It creates a dist folder. But within the dist folder there are several others:
- bundles
- esm5
- sm2015
- src
which are all locked out with no permission even voor administrator account. When logging of and logging in the folder is available again.
I used "handle" (SysInternals). And it was Fiddler! I have a Fiddler Auto-Responder rule to supply Dev build files from the File system while debugging a MS CRM html Web Resource, which just happens to be an Angular SPA. "dist" folder disappeared when Fiddler was closed, but seems like a painful developer cycle. I will have to clone it now, and point the Fiddler AR rule to the clone.
Was having a similar issue. running ng build would fail to completely delete the dist folder and would leave it in a state where I could not manually delete it or change permissions. Only after restarting the computer would the dist folder be gone and I could run ng build again. For me, it turns out the issue was that the code I was building was under my OneDrive directory. The OneDrive sync app must have retained a handle to the directory and prevented it from getting deleted. ng build seems to think the deletion occurred because it failed upon trying to create it again for the new build. Since moving my code out of the OneDrive directory I have not seen this issue again.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.