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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular CLI 12.2 has gyp errors when running 'npm ci' on Windows #21547

Closed
brodziakm opened this issue Aug 11, 2021 · 3 comments
Closed

Angular CLI 12.2 has gyp errors when running 'npm ci' on Windows #21547

brodziakm opened this issue Aug 11, 2021 · 3 comments

Comments

@brodziakm
Copy link

馃悶 Bug report

Command (mark with an x)

Not specifically an issue with a command, but possibly relating to dependency changes in 12.2.0

Is this a regression?

Yes, the previous version in which this bug was not present was: 12.1.0

Description

On Windows, in an Angular 12.2.0 project, 'npm ci' will result in a bunch of gyp errors that somehow relate to 'nice-napi'.

This seems to somehow relate to the introduction of piscina as a dependency in Angular CLI 12.2.0, and the problem may not be with Angular itself, but rather one of it's dependencies.

It may be that there are additional requirements for Angular 12.2 that were not required for Angular 12.1; if so, documentation on this would be useful.

馃敩 Minimal Reproduction

Create a new Angular 12.2.0 project on a Windows PC (using ng new). Run 'npm ci' and see the output.

Note that this doesn't happen with 'npm install'.

馃敟 Exception or Error


npm ci
npm WARN prepare removing existing node_modules/ before installation

> fsevents@1.2.13 install C:\my-app\node_modules\webpack-dev-server\node_modules\fsevents
> node install.js

Skipping 'fsevents' build as platform win32 is not supported

> nice-napi@1.0.2 install C:\my-app\node_modules\nice-napi
> node-gyp-build

C:\my-app\node_modules\nice-napi>if not defined npm_config_node_gyp (node "C:\ProgramData\nvm\v14.17.3\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\ProgramData\nvm\v14.17.3\node_modules\npm\node_modul
es\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! find Python

and a bunch of additional errors relating to the Python search.

After following node-gyp guidelines for Windows installations, the following trace results:


npm ci
npm WARN prepare removing existing node_modules/ before installation

> fsevents@1.2.13 install C:\my-app\node_modules\webpack-dev-server\node_modules\fsevents
> node install.js


Skipping 'fsevents' build as platform win32 is not supported

> nice-napi@1.0.2 install C:\my-app\node_modules\nice-napi
> node-gyp-build

C:\my-app\node_modules\nice-napi>if not defined npm_config_node_gyp (node "C:\ProgramData\nvm\v14.17.3\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\ProgramData\nvm\v14.17.3\node_modules\npm\node_modules\node-gyp\bin\node-gyp.j
s" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  nothing.c
  win_delay_load_hook.cc
  nothing.vcxproj -> C:\my-app\node_modules\nice-napi\build\Release\\nothing.lib
  binding.cc
  win_delay_load_hook.cc
C:\my-app\node_modules\nice-napi\binding.cc(2): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory [C:\my-app\node_modules\nice-napi\build\nice_napi.vcxproj]
鈫怺37;40mgyp鈫怺0m 鈫怺0m鈫怺31;40mERR!鈫怺0m 鈫怺0m鈫怺35mbuild error鈫怺0m
鈫怺0m鈫怺37;40mgyp鈫怺0m 鈫怺0m鈫怺31;40mERR!鈫怺0m 鈫怺0m鈫怺35mstack鈫怺0m Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
鈫怺0m鈫怺37;40mgyp鈫怺0m 鈫怺0m鈫怺31;40mERR!鈫怺0m 鈫怺0m鈫怺35mstack鈫怺0m     at ChildProcess.onExit (C:\ProgramData\nvm\v14.17.3\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
鈫怺0m鈫怺37;40mgyp鈫怺0m 鈫怺0m鈫怺31;40mERR!鈫怺0m 鈫怺0m鈫怺35mstack鈫怺0m     at ChildProcess.emit (events.js:375:28)
鈫怺0m鈫怺37;40mgyp鈫怺0m 鈫怺0m鈫怺31;40mERR!鈫怺0m 鈫怺0m鈫怺35mstack鈫怺0m     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
鈫怺0m鈫怺37;40mgyp鈫怺0m 鈫怺0m鈫怺31;40mERR!鈫怺0m 鈫怺0m鈫怺35mSystem鈫怺0m Windows_NT 10.0.19043
鈫怺0m鈫怺37;40mgyp鈫怺0m 鈫怺0m鈫怺31;40mERR!鈫怺0m 鈫怺0m鈫怺35mcommand鈫怺0m "C:\\Program Files\\nodejs\\node.exe" "C:\\ProgramData\\nvm\\v14.17.3\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
鈫怺0m鈫怺37;40mgyp鈫怺0m 鈫怺0m鈫怺31;40mERR!鈫怺0m 鈫怺0m鈫怺35mcwd鈫怺0m C:\my-app\node_modules\nice-napi
鈫怺0m鈫怺37;40mgyp鈫怺0m 鈫怺0m鈫怺31;40mERR!鈫怺0m 鈫怺0m鈫怺35mnode -v鈫怺0m v14.17.3
鈫怺0m鈫怺37;40mgyp鈫怺0m 鈫怺0m鈫怺31;40mERR!鈫怺0m 鈫怺0m鈫怺35mnode-gyp -v鈫怺0m v5.1.0
鈫怺0m鈫怺37;40mgyp鈫怺0m 鈫怺0m鈫怺31;40mERR!鈫怺0m 鈫怺0m鈫怺35mnot ok鈫怺0m

This seems to be trying to do something that isn't applicable to a Windows environment.

馃實 Your Environment


Angular CLI: 12.2.0
Node: 14.17.3
Package Manager: npm 6.14.13
OS: win32 x64

Angular: 12.2.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1202.0
@angular-devkit/build-angular   12.2.0
@angular-devkit/core            12.2.0
@angular-devkit/schematics      12.2.0
@schematics/angular             12.2.0
rxjs                            6.6.7
typescript                      4.3.5

Anything else relevant?

Operating system is Windows 10.

@brodziakm brodziakm changed the title Angular CLI 12.2 has gyp errors when running 'npm ci' Angular CLI 12.2 has gyp errors when running 'npm ci' on Windows Aug 11, 2021
@alan-agius4
Copy link
Collaborator

alan-agius4 commented Aug 11, 2021

Hi @brodziakm,

This seems to be an issue with NPM.

Unlike install, the ci command doesn鈥檛 gracefully handle build failures of optional dependencies.

More information about this can be found npm/cli#558

Our recommendation is to update to NPM 7, which should not longer have this bug or use an alternate package manager such as Yarn.

@brodziakm
Copy link
Author

Thanks @alan-agius4, we'll give it a try.

@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 Sep 11, 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

No branches or pull requests

2 participants