Automattic / Automattic/node-canvas
Intermittent npm install failures for node-canvas on Windows
- Dominant language
- JavaScript
- Stars
- 10.7k
- Forks
- 1.2k
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 1
Description
## Issue
Oftentimes, node-canvas installs on our build servers without issue, but sometimes it fails with the following output:
node-canvas 2.7.0:
```
> canvas@2.7.0 install C:\BuildAgent\work\757a28bcf1240baf\webserver\node_modules\canvas
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp ERR! Completion callback never invoked!
node-pre-gyp ERR! System Windows_NT 6.3.9600
node-pre-gyp ERR! command "C:\\Users\\Bamboo\\sq\\toolchain\\nodejs-12.13.0-64bit-windows\\files\\node.exe" "C:\\BuildAgent\\work\\757a28bcf1240baf\\webserver\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\BuildAgent\work\757a28bcf1240baf\webserver\node_modules\canvas
node-pre-gyp ERR! node -v v12.13.0
node-pre-gyp ERR! node-pre-gyp -v v0.15.0
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR!
npm ERR! code ELIFECYCLE
npm ERR! errno 6
npm ERR! canvas@2.7.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 6
npm ERR!
npm ERR! Failed at the canvas@2.7.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Bamboo\AppData\Roaming\npm-cache\_logs\2021-05-26T14_01_00_442Z-debug.log
```
node-canvas 2.6.1:
```
[18:10:38] : [Step 5/13] > canvas@2.6.1 install C:\BuildAgent\work\757a28bcf1240baf\webserver\node_modules\canvas
[18:10:38] : [Step 5/13] > node-pre-gyp install --fallback-to-build
[18:10:38] : [Step 5/13]
[18:10:38] : [Step 5/13] node-pre-gyp WARN Using request for node-pre-gyp https download
[18:11:04] : [Step 5/13] node-pre-gyp WARN Pre-built binaries not installable for canvas@2.6.1 and node@12.13.0 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
[18:11:04] : [Step 5/13] node-pre-gyp WARN Hit error read ECONNRESET
[18:13:02] : [Step 5/13] gyp ERR! clean error
[18:13:02] : [Step 5/13] gyp ERR! stack Error: EPERM: operation not permitted, unlink 'C:\BuildAgent\work\757a28bcf1240baf\webserver\node_modules\canvas\build\Release\obj\canvas\CanvasGradient.obj'
[18:13:02] : [Step 5/13] gyp ERR! System Windows_NT 6.3.9600
[18:13:02] : [Step 5/13] gyp ERR! command "C:\\Users\\Bamboo\\sq\\toolchain\\nodejs-12.13.0-64bit-windows\\files\\node.exe" "C:\\Users\\Bamboo\\sq\\toolchain\\nodejs-12.13.0-64bit-windows\\files\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "clean"
[18:13:02] : [Step 5/13] gyp ERR! cwd C:\BuildAgent\work\757a28bcf1240baf\webserver\node_modules\canvas
[18:13:02] : [Step 5/13] gyp ERR! node -v v12.13.0
[18:13:02] : [Step 5/13] gyp ERR! node-gyp -v v5.0.5
[18:13:02] : [Step 5/13] gyp ERR! not ok
[18:13:02] : [Step 5/13] node-pre-gyp ERR! build error
[18:13:02] : [Step 5/13] node-pre-gyp ERR! stack Error: Failed to execute 'C:\Users\Bamboo\sq\toolchain\nodejs-12.13.0-64bit-windows\files\node.exe C:\Users\Bamboo\sq\toolchain\nodejs-12.13.0-64bit-windows\files\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js clean' (1)
[18:13:02] : [Step 5/13] node-pre-gyp ERR! stack at ChildProcess. (C:\BuildAgent\work\757a28bcf1240baf\webserver\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
[18:13:02] : [Step 5/13] node-pre-gyp ERR! stack at ChildProcess.emit (events.js:210:5)
[18:13:02] : [Step 5/13] node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
[18:13:02] : [Step 5/13] node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
[18:13:02] : [Step 5/13] node-pre-gyp ERR! System Windows_NT 6.3.9600
[18:13:02] : [Step 5/13] node-pre-gyp ERR! command "C:\\Users\\Bamboo\\sq\\toolchain\\nodejs-12.13.0-64bit-windows\\files\\node.exe" "C:\\BuildAgent\\work\\757a28bcf1240baf\\webserver\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
[18:13:02] : [Step 5/13] node-pre-gyp ERR! cwd C:\BuildAgent\work\757a28bcf1240baf\webserver\node_modules\canvas
[18:13:02] : [Step 5/13] node-pre-gyp ERR! node -v v12.13.0
[18:13:02] : [Step 5/13] node-pre-gyp ERR! node-pre-gyp -v v0.11.0
[18:13:02] : [Step 5/13] node-pre-gyp ERR! not ok
[18:13:02] : [Step 5/13] Failed to execute 'C:\Users\Bamboo\sq\toolchain\nodejs-12.13.0-64bit-windows\files\node.exe C:\Users\Bamboo\sq\toolchain\nodejs-12.13.0-64bit-windows\files\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js clean' (1)
[18:13:02] : [Step 5/13] npm ERR! code ELIFECYCLE
[18:13:02] : [Step 5/13] npm ERR! errno 1
[18:13:02] : [Step 5/13] npm ERR! canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build`
[18:13:02] : [Step 5/13] npm ERR! Exit status 1
[18:13:02] : [Step 5/13] npm ERR!
[18:13:02] : [Step 5/13] npm ERR! Failed at the canvas@2.6.1 install script.
[18:13:02] : [Step 5/13] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[18:13:02] : [Step 5/13]
[18:13:02] : [Step 5/13] npm ERR! A complete log of this run can be found in:
[18:13:02] : [Step 5/13] npm ERR! C:\Users\Bamboo\AppData\Roaming\npm-cache\_logs\2021-01-29T02_13_02_558Z-debug.log
```
## Steps to Reproduce
- Add canvas 2.7.0 to package.json on Windows
- Run `npm install`
## Your Environment
* Version of node-canvas (output of `npm list canvas` or `yarn list canvas`): 2.7.0
* Environment (e.g. node 4.2.0 on Mac OS X 10.8): Windows_NT 6.3.9600, node 12.13.0
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.