Add nan as dev dependency to React templates #22089
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
nan
is an npm package that provides some helpful APIs for building native add-ons for Node. This package is a dependency offsvents
, another npm package that is used to watch for filesystem changes on macOS. Thewebpack
dependency used bycreate-react-app
brings in an older version offsevents
into our transitive dependencies but doesn't properly install thenan
dependency.This issue causes the
npm install
step to error our in our react and react-redux templates on macOS (since fsevents is a macOS-only package and other templates bring in thenan
package to the dependency tree via other transitive dependencies).To resolve this, we include
nan
as a dev dependency in the templates to ensure that it is installed.Customer Impact
This issue was discovered during manual testing. It only impacts react and react-redux templates running on macOS.
This bug breaks the
dotnet run
anddotnet publish
steps in the template project because thenpm install
step is unable to complete successfully as a result of the missing dependency.As a workaround, customers can install the
nan
dependency manually in theirClientApp
directories.Regression?
This change contains no regressions.
Risk
The risk level of this change is low because:
nan
is included as a dev dependency and shouldn't affect production or runtime environmentsAddresses https://github.com/aspnet/AspNetCore-ManualTests/issues/100