Skip to content

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

Closed
@brodziakm

Description

@brodziakm

🐞 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

> [email protected] install C:\my-app\node_modules\webpack-dev-server\node_modules\fsevents
> node install.js

Skipping 'fsevents' build as platform win32 is not supported

> [email protected] 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

> [email protected] install C:\my-app\node_modules\webpack-dev-server\node_modules\fsevents
> node install.js


Skipping 'fsevents' build as platform win32 is not supported

> [email protected] 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions