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

fix(@angular-devkit/build-angular): fix node 16 breaking when deleting the output path #21215

Conversation

terencehonles
Copy link

@terencehonles terencehonles commented Jun 26, 2021

According to rmdirSync 1 the recursive option is deprecated. The wording looks like it was changed (compared to Node LTS 2) to not include anything about ignoring errors on paths not existing. In the future the call should be rmSync(..., {..., force: true}), but when testing locally adding a "force" option does not restore the previous behavior. This isn't documented to work, but since the code original code is deprecated I was wondering if the underlying functionality was just passing all the options rmSync on Node 16.

This change includes an existence check to skip deleting a non existent directory.

Fixes: #21216

@google-cla google-cla bot added the cla: yes label Jun 26, 2021
@terencehonles
Copy link
Author

This looks like it also is related, but since exceptions are ignored I don't think this change is needed

…g the output path

According to `rmdirSync` [1] the `recursive` option is deprecated. The
wording looks like it was changed (compared to Node LTS [2]) to not
include anything about ignoring errors on paths not existing. In the
future the call should be `rmSync(..., {..., force: true})`, but when
testing locally adding a "force" option does not restore the previous
behavior. This isn't documented to work, but since the code original
code is deprecated I was wondering if the underlying functionality was
just passing all the options `rmSync` on Node 16.

This change includes an existence check to skip deleting a non existent
directory.

closes: angular#21216

[1]: https://nodejs.org/api/fs.html#fs_fs_rmdirsync_path_options
[2]: https://nodejs.org/docs/latest-v14.x/api/fs.html#fs_fs_rmdirsync_path_options
@terencehonles terencehonles force-pushed the fix-node-16-breaking-on-init branch from 8afb687 to a731b43 Compare June 26, 2021 21:00
@alan-agius4
Copy link
Collaborator

Duplicate of #21203

@alan-agius4 alan-agius4 marked this as a duplicate of #21203 Jun 27, 2021
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants