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

node-gyp arm64 node.lib returns HTTP code 403 #1933

Closed
Nederby opened this issue Oct 23, 2019 · 33 comments
Closed

node-gyp arm64 node.lib returns HTTP code 403 #1933

Nederby opened this issue Oct 23, 2019 · 33 comments

Comments

@Nederby
Copy link

Nederby commented Oct 23, 2019

First off I don't know if it's an issue with node-gyp or another repo.

Anyway it seems that something changed. We can no longer build Electron project. Older version (meaning old checkout git SHA) that used to work no compiles because of the issue.

I can see that the issue is with node.lib where it start fetching ia32, x64 and arm64 then arm64 fails with http response 403.

See below gyp verb on Windows; need to download node.lib...

The response is 403
gyp http 403 https://electronjs.org/headers/v5.0.11/win-arm64/node.lib

Please see the log below.:

Verbose output (from npm or node-gyp):
rebuilding native dependencies  dependencies=@felixrieseberg/spellchecker@4.0.10, cld@2.5.1, keyboard-layout@2.0.16, node-hid@0.7.9 platform=win32 arch=ia32
  • map async       taskCount=4
  • install prebuilt binary  name=node-hid version=0.7.9 platform=win32 arch=ia32
  • execute command  command='C:\Program Files (x86)\nodejs\node.exe' 'C:\projects\desktop-app\node_modules\prebuild-install\bin.js' --platform=win32 --arch=ia32 --target=5.0.11 --runtime=electron --verbose --force
                     workingDirectory=C:\projects\desktop-app\node_modules\node-hid
  • build native dependency from sources  name=node-hid
                                          version=0.7.9
                                          platform=win32
                                          arch=ia32
                                          reason=prebuild-install failed with error (run with env DEBUG=electron-builder to get more information)
                                          error=prebuild-install info begin Prebuild-install version 5.3.2
    prebuild-install WARN install prebuilt binaries enforced with --force!
    prebuild-install WARN install prebuilt binaries may be out of date!
    prebuild-install info looking for cached prebuild @ C:\Users\appveyor\AppData\Roaming\npm-cache\_prebuilds\e0d68f-node-hid-v0.7.9-electron-v70-win32-ia32.tar.gz
    prebuild-install http request GET https://github.com/node-hid/node-hid/releases/download/v0.7.9/node-hid-v0.7.9-electron-v70-win32-ia32.tar.gz
    prebuild-install http 404 https://github.com/node-hid/node-hid/releases/download/v0.7.9/node-hid-v0.7.9-electron-v70-win32-ia32.tar.gz
    prebuild-install WARN install No prebuilt binaries found (target=5.0.11 runtime=electron arch=ia32 libc= platform=win32)
    
  • execute command  command='C:\Program Files (x86)\nodejs\node.exe' 'C:\Users\appveyor\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js' rebuild --verbose @felixrieseberg/spellchecker@4.0.10 cld@2.5.1 keyboard-layout@2.0.16 node-hid@0.7.9
                     workingDirectory=
  ⨯ cannot execute  cause=exit status 1
                    out=
    > @felixrieseberg/spellchecker@4.0.10 install C:\projects\desktop-app\node_modules\@felixrieseberg\spellchecker
    > node-gyp rebuild
    
    
    C:\projects\desktop-app\node_modules\@felixrieseberg\spellchecker>if not defined npm_config_node_gyp (node "C:\Users\appveyor\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\appveyor\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) 
    
                    errorOut=npm info it worked if it ends with ok
    npm verb cli [ 'C:\\Program Files (x86)\\nodejs\\node.exe',
    npm verb cli   'C:\\Users\\appveyor\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
    npm verb cli   'rebuild',
    npm verb cli   '--verbose',
    npm verb cli   '@felixrieseberg/spellchecker@4.0.10',
    npm verb cli   'cld@2.5.1',
    npm verb cli   'keyboard-layout@2.0.16',
    npm verb cli   'node-hid@0.7.9' ]
    npm info using npm@6.12.0
    npm info using node@v10.16.0
    npm info readInstalled object
    npm verb rebuild path, id [ 'C:\\projects\\desktop-app\\node_modules\\@felixrieseberg\\spellchecker',
    npm verb rebuild   '@felixrieseberg/spellchecker@4.0.10' ]
    npm verb rebuild path, id [ 'C:\\projects\\desktop-app\\node_modules\\cld', 'cld@2.5.1' ]
    npm verb rebuild path, id [ 'C:\\projects\\desktop-app\\node_modules\\keyboard-layout',
    npm verb rebuild   'keyboard-layout@2.0.16' ]
    npm verb rebuild path, id [ 'C:\\projects\\desktop-app\\node_modules\\node-hid',
    npm verb rebuild   'node-hid@0.7.9' ]
    npm info build C:\projects\desktop-app\node_modules\@felixrieseberg\spellchecker
    npm info lifecycle @felixrieseberg/spellchecker@4.0.10~preinstall: @felixrieseberg/spellchecker@4.0.10
    npm info linkStuff @felixrieseberg/spellchecker@4.0.10
    npm verb rebuildBundles [ 'nan' ]
    npm info lifecycle @felixrieseberg/spellchecker@4.0.10~install: @felixrieseberg/spellchecker@4.0.10
    gyp info it worked if it ends with ok
    gyp verb cli [ 'C:\\Program Files (x86)\\nodejs\\node.exe',
    gyp verb cli   'C:\\Users\\appveyor\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js',
    gyp verb cli   'rebuild' ]
    gyp info using node-gyp@5.0.5
    gyp info using node@10.16.0 | win32 | ia32
    gyp verb command rebuild []
    gyp verb command clean []
    gyp verb clean removing "build" directory
    gyp verb command configure []
    gyp verb download using dist-url https://electronjs.org/headers
    gyp verb find Python Python is not set from command line or npm configuration
    gyp verb find Python Python is not set from environment variable PYTHON
    gyp verb find Python checking if "python" can be used
    gyp verb find Python - executing "python" to get executable path
    gyp verb find Python - executable path is "C:\Python27\python.exe"
    gyp verb find Python - executing "C:\Python27\python.exe" to get version
    gyp verb find Python - version is "2.7.16"
    gyp info find Python using Python version 2.7.16 found at "C:\Python27\python.exe"
    gyp verb get node dir compiling against --target node version: 5.0.11
    gyp verb command install [ '5.0.11' ]
    gyp verb download using dist-url https://electronjs.org/headers
    gyp verb install input version string "5.0.11"
    gyp verb install installing version: 5.0.11
    gyp verb install --ensure was passed, so won't reinstall if already installed
    gyp verb install version not already installed, continuing with install 5.0.11
    gyp verb ensuring nodedir is created C:\Users\appveyor\.electron-gyp\5.0.11
    gyp verb created nodedir C:\Users\appveyor\.electron-gyp
    gyp http GET https://electronjs.org/headers/v5.0.11/node-v5.0.11-headers.tar.gz
    gyp http 200 https://electronjs.org/headers/v5.0.11/node-v5.0.11-headers.tar.gz
    gyp verb extracted file from tarball node_headers/include/node/common.gypi
    gyp verb extracted file from tarball node_headers/include/node/config.gypi
    gyp verb extracted file from tarball node_headers/include/node/js_native_api.h
    gyp verb extracted file from tarball node_headers/include/node/js_native_api_types.h
    gyp verb extracted file from tarball node_headers/include/node/libplatform/libplatform-export.h
    gyp verb extracted file from tarball node_headers/include/node/libplatform/libplatform.h
    gyp verb extracted file from tarball node_headers/include/node/libplatform/v8-tracing.h
    gyp verb extracted file from tarball node_headers/include/node/node.h
    gyp verb extracted file from tarball node_headers/include/node/node_api.h
    gyp verb extracted file from tarball node_headers/include/node/node_api_types.h
    gyp verb extracted file from tarball node_headers/include/node/node_buffer.h
    gyp verb extracted file from tarball node_headers/include/node/node_object_wrap.h
    gyp verb extracted file from tarball node_headers/include/node/node_version.h
    gyp verb extracted file from tarball node_headers/include/node/uv/aix.h
    gyp verb extracted file from tarball node_headers/include/node/uv/android-ifaddrs.h
    gyp verb extracted file from tarball node_headers/include/node/uv/bsd.h
    gyp verb extracted file from tarball node_headers/include/node/uv/darwin.h
    gyp verb extracted file from tarball node_headers/include/node/uv/errno.h
    gyp verb extracted file from tarball node_headers/include/node/uv/linux.h
    gyp verb extracted file from tarball node_headers/include/node/uv/os390.h
    gyp verb extracted file from tarball node_headers/include/node/uv/posix.h
    gyp verb extracted file from tarball node_headers/include/node/uv/stdint-msvc2008.h
    gyp verb extracted file from tarball node_headers/include/node/uv/sunos.h
    gyp verb extracted file from tarball node_headers/include/node/uv/threadpool.h
    gyp verb extracted file from tarball node_headers/include/node/uv/tree.h
    gyp verb extracted file from tarball node_headers/include/node/uv/unix.h
    gyp verb extracted file from tarball node_headers/include/node/uv/version.h
    gyp verb extracted file from tarball node_headers/include/node/uv/win.h
    gyp verb extracted file from tarball node_headers/include/node/uv.h
    gyp verb extracted file from tarball node_headers/include/node/v8-internal.h
    gyp verb extracted file from tarball node_headers/include/node/v8-platform.h
    gyp verb extracted file from tarball node_headers/include/node/v8-profiler.h
    gyp verb extracted file from tarball node_headers/include/node/v8-testing.h
    gyp verb extracted file from tarball node_headers/include/node/v8-util.h
    gyp verb extracted file from tarball node_headers/include/node/v8-value-serializer-version.h
    gyp verb extracted file from tarball node_headers/include/node/v8-version-string.h
    gyp verb extracted file from tarball node_headers/include/node/v8-version.h
    gyp verb extracted file from tarball node_headers/include/node/v8-wasm-trap-handler-posix.h
    gyp verb extracted file from tarball node_headers/include/node/v8-wasm-trap-handler-win.h
    gyp verb extracted file from tarball node_headers/include/node/v8.h
    gyp verb extracted file from tarball node_headers/include/node/v8config.h
    gyp verb extracted file from tarball node_headers/include/node/zconf.h
    gyp verb extracted file from tarball node_headers/include/node/zlib.h
    gyp verb content checksum node-v5.0.11-headers.tar.gz 04fef9e1f7652930f3262444bb94d30f8890dbac515dde8ce969cd645f531b63
    gyp verb tarball done parsing tarball
    gyp verb on Windows; need to download `node.lib`... 
    gyp verb ia32 node.lib dir C:\Users\appveyor\.electron-gyp\5.0.11\ia32
    gyp verb ia32 node.lib url https://electronjs.org/headers/v5.0.11/win-x86/node.lib
    gyp verb x64 node.lib dir C:\Users\appveyor\.electron-gyp\5.0.11\x64
    gyp verb x64 node.lib url https://electronjs.org/headers/v5.0.11/win-x64/node.lib
    gyp verb arm64 node.lib dir C:\Users\appveyor\.electron-gyp\5.0.11\arm64
    gyp verb arm64 node.lib url https://electronjs.org/headers/v5.0.11/win-arm64/node.lib
    gyp verb check download content checksum, need to download `SHASUMS256.txt`... 
    gyp verb checksum url https://electronjs.org/headers/v5.0.11/SHASUMS256.txt
    gyp http GET https://electronjs.org/headers/v5.0.11/SHASUMS256.txt
    gyp verb streaming ia32 node.lib to: C:\Users\appveyor\.electron-gyp\5.0.11\ia32\node.lib
    gyp http GET https://electronjs.org/headers/v5.0.11/win-x86/node.lib
    gyp verb streaming x64 node.lib to: C:\Users\appveyor\.electron-gyp\5.0.11\x64\node.lib
    gyp http GET https://electronjs.org/headers/v5.0.11/win-x64/node.lib
    gyp verb streaming arm64 node.lib to: C:\Users\appveyor\.electron-gyp\5.0.11\arm64\node.lib
    gyp http GET https://electronjs.org/headers/v5.0.11/win-arm64/node.lib
    gyp http 200 https://electronjs.org/headers/v5.0.11/SHASUMS256.txt
    gyp verb checksum data {"node-v5.0.11.tar.gz":"04fef9e1f7652930f3262444bb94d30f8890dbac515dde8ce969cd645f531b63","node-v5.0.11-headers.tar.gz":"04fef9e1f7652930f3262444bb94d30f8890dbac515dde8ce969cd645f531b63","iojs-v5.0.11.tar.gz":"04fef9e1f7652930f3262444bb94d30f8890dbac515dde8ce969cd645f531b63","iojs-v5.0.11-headers.tar.gz":"04fef9e1f7652930f3262444bb94d30f8890dbac515dde8ce969cd645f531b63","node.lib":"57862b2cdbab4bf0a47d831d3b59179b9a9411d8dc5fdb62fac26c80a6e2dd74","x64/node.lib":"76a2aade3db44e331af54aeac451a39a998324d9b7a2dcf2685707b58983abd2","win-x86/iojs.lib":"57862b2cdbab4bf0a47d831d3b59179b9a9411d8dc5fdb62fac26c80a6e2dd74","win-x64/iojs.lib":"76a2aade3db44e331af54aeac451a39a998324d9b7a2dcf2685707b58983abd2","win-x86/node.lib":"57862b2cdbab4bf0a47d831d3b59179b9a9411d8dc5fdb62fac26c80a6e2dd74","win-x64/node.lib":"76a2aade3db44e331af54aeac451a39a998324d9b7a2dcf2685707b58983abd2"}
    gyp http 403 https://electronjs.org/headers/v5.0.11/win-arm64/node.lib
    gyp WARN install got an error, rolling back install
    gyp verb command remove [ '5.0.11' ]
    gyp verb remove using node-gyp dir: C:\Users\appveyor\.electron-gyp
    gyp verb remove removing target version: 5.0.11
    gyp verb remove removing development files for version: 5.0.11
    gyp http 200 https://electronjs.org/headers/v5.0.11/win-x86/node.lib
    gyp ERR! configure error 
    gyp ERR! stack Error: 403 status code downloading arm64 node.lib
    gyp ERR! stack     at Request.<anonymous> (C:\Users\appveyor\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\install.js:335:22)
    gyp ERR! stack     at Request.emit (events.js:203:15)
    gyp ERR! stack     at Request.onRequestResponse (C:\Users\appveyor\AppData\Roaming\npm\node_modules\npm\node_modules\request\request.js:1066:10)
    gyp ERR! stack     at ClientRequest.emit (events.js:198:13)
    gyp ERR! stack     at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:556:21)
    gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
    gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:442:20)
    gyp ERR! stack     at TLSSocket.emit (events.js:198:13)
    gyp ERR! stack     at addChunk (_stream_readable.js:288:12)
    gyp ERR! stack     at readableAddChunk (_stream_readable.js:269:11)
    gyp ERR! System Windows_NT 6.3.9600
    gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\appveyor\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
    gyp ERR! cwd C:\projects\desktop-app\node_modules\@felixrieseberg\spellchecker
    gyp ERR! node -v v10.16.0
    gyp ERR! node-gyp -v v5.0.5
    gyp ERR! not ok 
    npm verb lifecycle @felixrieseberg/spellchecker@4.0.10~install: unsafe-perm in lifecycle true
    npm verb lifecycle @felixrieseberg/spellchecker@4.0.10~install: PATH: C:\Users\appveyor\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\projects\desktop-app\node_modules\@felixrieseberg\spellchecker\node_modules\.bin;C:\projects\desktop-app\node_modules\.bin;C:\Users\appveyor\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\projects\desktop-app\node_modules\.bin;C:\Users\appveyor\AppData\Roaming\npm;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\Perl\site\bin;C:\Perl\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\7-Zip;C:\Program Files\Microsoft\Web Platform Installer\;C:\Tools\GitVersion;C:\Tools\PsTools;C:\Program Files\Git LFS;C:\Program Files (x86)\Subversion\bin;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Tools\WebDriver;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.4\;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\wbin;C:\Ruby193\bin;C:\Tools\NUnit\bin;C:\Tools\xUnit;C:\Tools\MSpec;C:\Tools\Coverity\bin;C:\Program Files (x86)\CMake\bin;C:\go\bin;C:\Program Files\Java\jdk1.8.0\bin;C:\Python27;C:\Program Files\nodejs;C:\Program Files (x86)\iojs;C:\Program Files\iojs;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\MSBuild\14.0\Bin;C:\Tools\NuGet;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft DNX\Dnvm;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Apache\Maven\bin;C:\Python27\Scripts;C:\Tools\NUnit3;C:\Program Files\Mercurial\;C:\Program Files\dotnet\;C:\Tools\curl\bin;C:\Program Files\Amazon\AWSCLI\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\140;C:\Tools\vcpkg;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files\erl9.2\bin;C:\Program Files (x86)\NSIS;C:\Tools\Octopus;C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\LLVM\bin;C:\Users\appveyor\AppData\Roaming\npm;C:\Program Files\PowerShell\6\;C:\Program Files (x86)\nodejs\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\Yarn\bin\;C:\ProgramData\chocolatey\bin;C:\Users\appveyor\.dotnet\tools;C:\Users\appveyor\AppData\Roaming\npm;C:\Users\appveyor\AppData\Local\Yarn\bin;C:\Program Files\AppVeyor\BuildAgent\
    npm verb lifecycle @felixrieseberg/spellchecker@4.0.10~install: CWD: C:\projects\desktop-app\node_modules\@felixrieseberg\spellchecker
    npm info lifecycle @felixrieseberg/spellchecker@4.0.10~install: Failed to exec install script
    npm verb stack Error: @felixrieseberg/spellchecker@4.0.10 install: `node-gyp rebuild`
    npm verb stack Exit status 1
    npm verb stack     at EventEmitter.<anonymous> (C:\Users\appveyor\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
    npm verb stack     at EventEmitter.emit (events.js:198:13)
    npm verb stack     at ChildProcess.<anonymous> (C:\Users\appveyor\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
    npm verb stack     at ChildProcess.emit (events.js:198:13)
    npm verb stack     at maybeClose (internal/child_process.js:982:16)
    npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
    npm verb pkgid @felixrieseberg/spellchecker@4.0.10
    npm verb cwd C:\projects\desktop-app
    npm verb Windows_NT 6.3.9600
    npm verb argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\appveyor\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "rebuild" "--verbose" "@felixrieseberg/spellchecker@4.0.10" "cld@2.5.1" "keyboard-layout@2.0.16" "node-hid@0.7.9"
    npm verb node v10.16.0
    npm verb npm  v6.12.0
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! @felixrieseberg/spellchecker@4.0.10 install: `node-gyp rebuild`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the @felixrieseberg/spellchecker@4.0.10 install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    npm verb exit [ 1, true ]
    npm timing npm Completed in 4471ms
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\appveyor\AppData\Roaming\npm-cache\_logs\2019-10-23T20_56_51_214Z-debug.log
    
                    command='C:\Program Files (x86)\nodejs\node.exe' 'C:\Users\appveyor\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js' rebuild --verbose @felixrieseberg/spellchecker@4.0.10 cld@2.5.1 keyboard-layout@2.0.16 node-hid@0.7.9
                    workingDir=
  • exited          command=app-builder.exe code=2 pid=2752
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! Exit status 1
npm ERR! 

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\appveyor\AppData\Roaming\npm-cache\_logs\2019-10-23T20_56_51_302Z-debug.log
Command exited with code 1

Thanks in advance

@richardlau
Copy link
Member

It'll be because of #1875. It looks like a 404 error code is handled but not 403:

node-gyp/lib/install.js

Lines 326 to 336 in 4fff845

if (res.statusCode === 404) {
if (arch === 'arm64') {
// Arm64 is a newer platform on Windows and not all node distributions provide it.
log.verbose(`${name} was not found in ${libUrl}`)
} else {
log.warn(`${name} was not found in ${libUrl}`)
}
return
} else if (res.statusCode !== 200) {
done(new Error(res.statusCode + ' status code downloading ' + name))
return

cc @joaocgreis

@NickZ
Copy link

NickZ commented Oct 23, 2019

Confirming this error. log:

npx node-gyp rebuild --target=4.2.12 --arch=x64 --dist-url="https://electronjs.org/headers" --build-from-source
gyp info it worked if it ends with ok
gyp info using node@10.17.0 | win32 | x64
gyp info find Python using Python version 2.7.17 found at "C:\Python27\python.exe"
gyp http GET https://electronjs.org/headers/v4.2.12/node-v4.2.12-headers.tar.gz
gyp http 200 https://electronjs.org/headers/v4.2.12/node-v4.2.12-headers.tar.gz
gyp http GET https://electronjs.org/headers/v4.2.12/SHASUMS256.txt
gyp http GET https://electronjs.org/headers/v4.2.12/win-x64/node.lib
gyp http GET https://electronjs.org/headers/v4.2.12/win-x86/node.lib
gyp http GET https://electronjs.org/headers/v4.2.12/win-arm64/node.lib
gyp http 200 https://electronjs.org/headers/v4.2.12/win-x64/node.lib
gyp http 200 https://electronjs.org/headers/v4.2.12/SHASUMS256.txt
gyp http 200 https://electronjs.org/headers/v4.2.12/win-x86/node.lib
gyp ERR! configure error
gyp ERR! stack Error: 403 status code downloading arm64 node.lib
gyp ERR! stack     at Request.<anonymous> (C:\Users\nick\Desktop\steamgyro\node_modules\node-gyp\lib\install.js:335:22)
gyp ERR! stack     at Request.emit (events.js:203:15)
gyp ERR! stack     at Request.onRequestResponse (C:\Users\nick\Desktop\steamgyro\node_modules\request\request.js:1066:10)
gyp ERR! stack     at ClientRequest.emit (events.js:198:13)
gyp ERR! stack     at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:556:21)
gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:442:20)
gyp ERR! stack     at TLSSocket.emit (events.js:198:13)
gyp ERR! stack     at addChunk (_stream_readable.js:287:12)
gyp ERR! stack     at readableAddChunk (_stream_readable.js:268:11)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\nick\\Desktop\\steamgyro\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=4.2.12" "--arch=x64" "--dist-url=https://electronjs.org/headers" "--build-from-source"
gyp ERR! cwd C:\Users\nick\Desktop\steamgyro
gyp ERR! node -v v10.17.0
gyp ERR! node-gyp -v v6.0.0
gyp ERR! not ok

@richardlau
Copy link
Member

PR: #1934

@Nederby
Copy link
Author

Nederby commented Oct 24, 2019

@richardlau will the fix be deployed as a patch to 5.0.x also?

@rvagg
Copy link
Member

rvagg commented Oct 24, 2019

@Nederby we'll probably do a backport of most of the the v6.0.1 (#1935) commits into a new v5.x release soon after.

@amknight
Copy link

Is there any workaround for this issue?
I am encountering it with Electron 5.0.11 & Node 10.17.0

@thiagorova
Copy link

Hello. I just tried installing the v6.0.1-proposal (which technically fixes this issue) and this error remains.

System info:
OS: Windows 7 64 bits.
node: 12.13.0
Python: 2.7
npm: 6.12
Electron: 4.2.12

(Just in case I did something stupid)

I just ran:
npm i -g nodejs/node-gyp#rvagg/v6.0.1-proposal
and then
npm i
inside my workspace

Installing node-gyp was successful, but npm i failed with the 403 arms error
Thanks!

@Nederby
Copy link
Author

Nederby commented Oct 29, 2019

@amknight you can get around this issue by using npm v6.11.3 (npm install -g npm@6.11.3) that version includes an older version of node-gyp before the issue was introduced.

@richardlau
Copy link
Member

Hello. I just tried installing the v6.0.1-proposal (which technically fixes this issue) and this error remains.

System info:
OS: Windows 7 64 bits.
node: 12.13.0
Python: 2.7
npm: 6.12
Electron: 4.2.12

(Just in case I did something stupid)

I just ran:
npm i -g nodejs/node-gyp#rvagg/v6.0.1-proposal
and then
npm i
inside my workspace

Installing node-gyp was successful, but npm i failed with the 403 arms error
Thanks!

I think you'll also need to npm set config node_gyp as documented in #1715 (comment).

@thiagorova
Copy link

Hello. I just tried installing the v6.0.1-proposal (which technically fixes this issue) and this error remains.
System info:
OS: Windows 7 64 bits.
node: 12.13.0
Python: 2.7
npm: 6.12
Electron: 4.2.12
(Just in case I did something stupid)
I just ran:
npm i -g nodejs/node-gyp#rvagg/v6.0.1-proposal
and then
npm i
inside my workspace
Installing node-gyp was successful, but npm i failed with the 403 arms error
Thanks!

I think you'll also need to npm set config node_gyp as documented in #1715 (comment).

Yup, this worked, thanks!

@sundong212
Copy link

sundong212 commented Nov 1, 2019

Hi, I have encounter the same issue.
System info:
OS: Windows 10 x64 64bits
node: 10.15.x
Python: 2.7.2
npm: 6.11.3
Electron: 4.0.x

The issue popped up yesterday.
Here is the error message that I got
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 403 status code downloading arm64 node.lib
gyp ERR! stack at Request. (C:\Users\sds\Documents\software\node_modules\node
-gyp\lib\install.js:335:22)
gyp ERR! stack at Request.emit (events.js:194:15)
gyp ERR! stack at Request.onRequestResponse (C:\Users\sds\Documents\software\node_module
s\request\request.js:1066:10)
gyp ERR! stack at ClientRequest.emit (events.js:189:13)
gyp ERR! stack at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:556:21)
gyp ERR! stack at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
gyp ERR! stack at TLSSocket.socketOnData (_http_client.js:442:20)
gyp ERR! stack at TLSSocket.emit (events.js:189:13)
gyp ERR! stack at addChunk (_stream_readable.js:284:12)
gyp ERR! stack at readableAddChunk (_stream_readable.js:265:11)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\sds\Documents\software
\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--target=5.0.11" "--arch=x64" "--dist-url=http
s://electronjs.org/headers" "--build-from-source"
gyp ERR! cwd C:\Users\sds\Documents\software\node_modules\ffi\node_modules\ref
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok

Failed with exit code: 1

Error: gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 403 status code downloading arm64 node.lib
gyp ERR! stack at Request. (C:\Users\sds\Documents\software\node_modules\node
-gyp\lib\install.js:335:22)
gyp ERR! stack at Request.emit (events.js:194:15)
gyp ERR! stack at Request.onRequestResponse (C:\Users\sds\Documents\software\node_module
s\request\request.js:1066:10)
gyp ERR! stack at ClientRequest.emit (events.js:189:13)
gyp ERR! stack at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:556:21)
gyp ERR! stack at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
gyp ERR! stack at TLSSocket.socketOnData (_http_client.js:442:20)
gyp ERR! stack at TLSSocket.emit (events.js:189:13)
gyp ERR! stack at addChunk (_stream_readable.js:284:12)
gyp ERR! stack at readableAddChunk (_stream_readable.js:265:11)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\sds\Documents\software
\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--target=5.0.11" "--arch=x64" "--dist-url=http
s://electronjs.org/headers" "--build-from-source"
gyp ERR! cwd C:\Users\sds\Documents\software\node_modules\ffi\node_modules\ref
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok

Any help would be appreciated!

@cclauss
Copy link
Contributor

cclauss commented Nov 1, 2019

Probably not the source of your problem but Python: 2.7.2 -- You really want to be >= 2.7.9

@Ciriak
Copy link

Ciriak commented Nov 1, 2019

Same issue here, the proposed workarounds doesn't seem to work

Win 10 X64
npm@6.12.1
node@10.15.3
node-gyp@6.0.1

tinyAdapter added a commit to project-yuki/YUKI that referenced this issue Nov 3, 2019
Manually set dependency version of node-gyp to electron-rebuild to v6.0.1 as a temporarily workaround

See nodejs/node-gyp#1933
@gannons
Copy link

gannons commented Nov 4, 2019

@amknight you can get around this issue by using npm v6.11.3 (npm install -g npm@6.11.3) that version includes an older version of node-gyp before the issue was introduced.

I installed 6.12.1 and hit the same issue (previous version installed was 6.9.0)

@gannons
Copy link

gannons commented Nov 4, 2019

This looks like a misconfiguration on the server which causes a 403 when accessing

Seems #1875 states that

arm64 is not expected to work in very old node.lib distribution formats

which I assume v4.2.11 falls under. Is there any plan to fix the issue above mentioned by @richardlau?

@WelaurS
Copy link

WelaurS commented Nov 4, 2019

Getting the same error.

node@12.13.0
npm@6.12.0
node-gyp@6.0.1
python@2.7.15

@gannons
Copy link

gannons commented Nov 4, 2019

I was able to work around by modifying the local node-gyp install.js

Path: .\node_modules\node-gyp\lib\install.js (On Windows)

I changed

  function downloadNodeLib (done) {
    log.verbose('on Windows; need to download `' + release.name + '.lib`...')
    var archs = ['ia32', 'x64', 'arm64']
    var async = archs.length

to

  function downloadNodeLib (done) {
    log.verbose('on Windows; need to download `' + release.name + '.lib`...')
    var archs = ['ia32', 'x64']
    var async = archs.length

i.e. I removed the arm64 arch.

Obviously not a long term solution but it lets me make a little progress

@sundong212
Copy link

I was able to work around by modifying the local node-gyp install.js

Path: .\node_modules\node-gyp\lib\install.js (On Windows)

I changed

  function downloadNodeLib (done) {
    log.verbose('on Windows; need to download `' + release.name + '.lib`...')
    var archs = ['ia32', 'x64', 'arm64']
    var async = archs.length

to

  function downloadNodeLib (done) {
    log.verbose('on Windows; need to download `' + release.name + '.lib`...')
    var archs = ['ia32', 'x64']
    var async = archs.length

i.e. I removed the arm64 arch.

Obviously not a long term solution but it lets me make a little progress

Yeah, that works for me. Thank you.

But it seems like the arm64 file is missing on the server.

@gannons
Copy link

gannons commented Nov 4, 2019

Yeah, that works for me. Thank you.

But it seems like the arm64 file is missing on the server.

Yes that's the root issue. Either the arm64 image is missing or the server is mis-configured.

Either way it seems like a bug that needs to be resolved by node-gyp. It should gracefully handled the 403 as mentioned above.

@joaocgreis
Copy link
Member

This should be fixed in node-gyp@6.0.1.

@WelaurS @Ciriak and anyone else using 6.0.1, did you do npm set config node_gyp as documented in #1715 (comment) ? If you did, there's something wrong with the fix.

  • If when the error happens you see the line confirming the version gyp ERR! node-gyp -v v6.0.1, please run again with --silly and paste the output here (it will be large).
  • If it is some other version of node-gyp, please run with --verbose instead and paste here.

@Ciriak
Copy link

Ciriak commented Nov 5, 2019

Just noticed in the Error log that my version is still 5.0.5 (despite having removed, reinstalled the @latest ), so my issue probably come from here 🤔

image

image

Edit : ok, i found the problem

@sundong212
Copy link

Node Headers URL
This is the URL specified as disturl in a .npmrc file or as the --dist-url command line flag when building native Node modules. Both will be supported for the foreseeable future but it is recommended that you switch.

Deprecated: atom.io/download/electron

Replace with: electronjs.org/headers

The error I hit is downloading win-arm64, and I try to use the same link with win-x64 and win-ia32,
I can download the win-x64 node.lib file, but failed at win-ia32 and win-arm64. I believe this is the issue with electron rather than node-gyp because the header is changed by electron in its latest 7.0.

@gannons
Copy link

gannons commented Nov 5, 2019

This should be fixed in node-gyp@6.0.1.

I can confirm that version 6.0.1 fixes this issue for me.

The latest LTS release of nodejs (12.13.0) comes with node-gyp 5.0.5. This is the version of node-gyp used to build native modules during an npm install.

However I see this issue during Electron's rebuild of the native rebuild. The electron-rebuild.cmd uses the version of node-gyp in the local node_modules. Hence I can work around this by listing node-gyp 6.0.1 as a dependency in package.json.

@Yashraj890
Copy link

Yashraj890 commented Nov 20, 2019

Hello Team

I found one solution for this issue, just run the below command

npm install sqlite3 --build-from-source --runtime-electron --target-|YOUR ELECTRON VERSION| --dist-url=https://atom.io/download/electron

After running the above command, please run the - npm rebuild

Please let me know if anyone is able to resolve the issue with my solution.

Thanks

zxch3n added a commit to zxch3n/PomodoroLogger that referenced this issue Dec 27, 2019
This caused build fail on github action.

see nodejs/node-gyp#1933 (comment)
@mecharmor
Copy link

@amknight you can get around this issue by using npm v6.11.3 (npm install -g npm@6.11.3) that version includes an older version of node-gyp before the issue was introduced.

This fixed the issue for me

@asakiasako
Copy link

@amknight you can get around this issue by using npm v6.11.3 (npm install -g npm@6.11.3) that version includes an older version of node-gyp before the issue was introduced.

Thanks, this works for me

@awakeel

This comment has been minimized.

@Kevintirta
Copy link

An unhandled error occurred inside electron-rebuild
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 403 status code downloading arm64 node.lib
gyp ERR! stack     at Request.<anonymous> (C:\Users\Civdrone\Desktop\Civdrone\civ-drone-planner\node_modules\electron-rebuild\node_modules\node-gyp\lib\install.js:335:22)
gyp ERR! stack     at Request.emit (events.js:228:7)
gyp ERR! stack     at Request.onRequestResponse (C:\Users\Civdrone\Desktop\Civdrone\civ-drone-planner\node_modules\request\request.js:1066:10) 
gyp ERR! stack     at ClientRequest.emit (events.js:223:5)
gyp ERR! stack     at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:592:27)
gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:116:17)
gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:465:22)
gyp ERR! stack     at TLSSocket.emit (events.js:223:5)
gyp ERR! stack     at addChunk (_stream_readable.js:309:12)
gyp ERR! stack     at readableAddChunk (_stream_readable.js:290:11)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Civdrone\\Desktop\\Civdrone\\civ-drone-planner\\node_modules\\electron-rebuild\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=4.2.12" "--arch=x64" "--dist-url=https://electronjs.org/headers" "--build-from-source"
gyp ERR! cwd C:\Users\Civdrone\Desktop\Civdrone\civ-drone-planner\node_modules\@serialport\bindings
gyp ERR! node -v v12.15.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok

For 403 error happen inside electron rebuild, you should update your electron-rebuild:

npm i electron-rebuild --save-dev

it works for me for electron-rebuild version 1.10.0

@joaocgreis
Copy link
Member

The only versions with this problem are 5.0.5 and 6.0.0.

If you encounter this issue please upgrade to 5.0.6 or 6.0.1, which have a fix for this.

@kode54
Copy link

kode54 commented Feb 19, 2020

I am experiencing this trying to retrieve:
https://atom.io/download/electron/v13.8.0/node-v13.8.0-headers.tar.gz

Using:

node 13.8.0
npm 6.13.7
Python 3.8.1
Python 2.7.17
Electron 6.1.7

Attempting to install a freaking spellcheck module for the latest release of ssb-patchwork.

EDIT: Oh for chrissakes. This stupid thing won't build unless I run the build from a terminal within a graphical desktop. A TTY won't do.

@Hariprabu94
Copy link

It'll be because of #1875. It looks like a 404 error code is handled but not 403:

node-gyp/lib/install.js

Lines 326 to 336 in 4fff845

if (res.statusCode === 404) {
if (arch === 'arm64') {
// Arm64 is a newer platform on Windows and not all node distributions provide it.
log.verbose(`${name} was not found in ${libUrl}`)
} else {
log.warn(`${name} was not found in ${libUrl}`)
}
return
} else if (res.statusCode !== 200) {
done(new Error(res.statusCode + ' status code downloading ' + name))
return

cc @joaocgreis

Hi, Am getting following error while installing electron on raspberrypi 4

HTTPError: Response code 404 (Not Found) for https://github.com/electron/electron/releases/download/v10.1.2/electron-v10.1.2-linux-aarch64.zip
    at EventEmitter.emitter.on.response (/usr/local/lib/node_modules/electron/node_modules/got/source/as-stream.js:35:24)
    at EventEmitter.emit (events.js:189:13)
    at module.exports (/usr/local/lib/node_modules/electron/node_modules/got/source/get-response.js:22:10)
    at ClientRequest.handleResponse (/usr/local/lib/node_modules/electron/node_modules/got/source/request-as-event-emitter.js:155:5)
    at Object.onceWrapper (events.js:277:13)
    at ClientRequest.emit (events.js:194:15)
    at ClientRequest.origin.emit.args [as emit] (/usr/local/lib/node_modules/electron/node_modules/@szmarczak/http-timer/source/index.js:37:11)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:556:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
    at TLSSocket.socketOnData (_http_client.js:442:20)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@10.1.2 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the electron@10.1.2 postinstall 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!     /root/.npm/_logs/2020-09-28T01_21_36_825Z-debug.log

kindly assist
Thank you

@rvagg
Copy link
Member

rvagg commented Sep 28, 2020

You should probably take that one up with the electron team. It looks like they do arm64 releases but I'm not sure why it's insisting on using an aarch64 identifier. But also, depending on the OS you're using maybe it should be using armv7, not arm64. 🤷

@Pangyuyu
Copy link

I was able to work around by modifying the local node-gyp install.js
Path: .\node_modules\node-gyp\lib\install.js (On Windows)
I changed

  function downloadNodeLib (done) {
    log.verbose('on Windows; need to download `' + release.name + '.lib`...')
    var archs = ['ia32', 'x64', 'arm64']
    var async = archs.length

to

  function downloadNodeLib (done) {
    log.verbose('on Windows; need to download `' + release.name + '.lib`...')
    var archs = ['ia32', 'x64']
    var async = archs.length

i.e. I removed the arm64 arch.
Obviously not a long term solution but it lets me make a little progress

Yeah, that works for me. Thank you.

But it seems like the arm64 file is missing on the server.

谢谢!这个多年前的回答帮到了我。
Thank you

@nodejs nodejs locked as resolved and limited conversation to collaborators May 15, 2022
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 a pull request may close this issue.