ranisalt / node-argon2

Node.js bindings for Argon2 hashing algorithm
https://www.npmjs.com/package/argon2
MIT License
1.86k stars 92 forks source link

v0.26.1 installation failure on Windows #255

Closed MicrochipQ closed 4 years ago

MicrochipQ commented 4 years ago

Welcome to the issues section if it's your first time!

Before creating an issue, please be sure to:

Steps to reproduce

  1. yarn add argon2@0.26.1

Expected behaviour

Installation must be completed successfully

Actual behaviour

Installation failed. But I tried to install argon2@0.26.0, and it was successfully installed.

Environment

Operating system: Windows Server 2012 R2 Node version: v13.12.0 Compiler version: node-pre-gyp -v v0.14.0

MicrochipQ commented 4 years ago

Logs:

PS E:\argontest> yarn add argon2
yarn add v1.22.4
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error E:\argontest\node_modules\argon2: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build
Arguments:
Directory: E:\argontest\node_modules\argon2
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.14.0
node-pre-gyp info using node@13.12.0 | win32 | x64
node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp info check checked for "E:\argontest\node_modules\argon2\lib\bindin
g\argon2.node" (not found)
node-pre-gyp http GET https://github.com/ranisalt/node-argon2/releases/download/
v0.26.1/argon2-v0.26.1-node-v79-win32-x64.tar.gz
node-pre-gyp http 302 https://github.com/ranisalt/node-argon2/releases/download/
v0.26.1/argon2-v0.26.1-node-v79-win32-x64.tar.gz
node-pre-gyp http 404 https://github.com/ranisalt/node-argon2/releases/download/
v0.26.1/argon2-v0.26.1-node-v79-win32-x64.tar.gz
node-pre-gyp WARN Tried to download(404): https://github.com/ranisalt/node-argon
2/releases/download/v0.26.1/argon2-v0.26.1-node-v79-win32-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for argon2@0.26.1 and node@13.12.
0 (node-v79 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://github.com/ranisal
t/node-argon2/releases/download/v0.26.1/argon2-v0.26.1-node-v79-win32-x64.tar.gz

E:\argontest\node_modules\argon2>if not defined npm_config_node_gyp (node "C:\Pr
ogram Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gy
p\bin\node-gyp.js" clean )  else (node "" clean )
gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@13.12.0 | win32 | x64
gyp info ok

E:\argontest\node_modules\argon2>if not defined npm_config_node_gyp (node "C:\Pr
ogram Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gy
p\bin\node-gyp.js" configure --fallback-to-build --module=E:\argontest\node_modu
les\argon2\lib\binding\argon2.node --module_name=argon2 --module_path=E:\argonte
st\node_modules\argon2\lib\binding --napi_version=6 --node_abi_napi=napi --napi_
build_version=0 --node_napi_label=node-v79 )  else (node "" configure --fallback
-to-build --module=E:\argontest\node_modules\argon2\lib\binding\argon2.node --mo
dule_name=argon2 --module_path=E:\argontest\node_modules\argon2\lib\binding --na
pi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-
v79 )
gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@13.12.0 | win32 | x64
gyp info find Python using Python version 2.7.15 found at "C:\Python27\python.ex
e"
gyp info find VS using VS2017 (15.9.28307.222) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools
"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Python27\python.exe
gyp info spawn args [
gyp info spawn args   'C:\\nvm\\v13.12.0\\node_modules\\npm\\node_modules\\node-
gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-I',
gyp info spawn args   'E:\\argontest\\node_modules\\argon2\\build\\config.gypi',

gyp info spawn args   '-I',
gyp info spawn args   'C:\\nvm\\v13.12.0\\node_modules\\npm\\node_modules\\node-
gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Ђ¤¬Ё­Ёбва в®а\\AppData\\Local\\node-gyp\\Cache
\\13.12.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Ђ¤¬Ё­Ёбва в®а\\AppData\\Local\
\node-gyp\\Cache\\13.12.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\nvm\\v13.12.0\\node_modules\\npm\\node
_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\Ђ¤¬Ё­Ёбва в®а\\\\AppData\\
\\Local\\\\node-gyp\\\\Cache\\\\13.12.0\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=E:\\argontest\\node_modules\\argon2',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'E:\\argontest\\node_modules\\argon2\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
Traceback (most recent call last):
  File "C:\nvm\v13.12.0\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py",
 line 50, in <module>
    sys.exit(gyp.script_main())
  File "C:\nvm\v13.12.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__i
nit__.py", line 554, in script_main
    return main(sys.argv[1:])
  File "C:\nvm\v13.12.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__i
nit__.py", line 547, in main
    return gyp_main(args)
  File "C:\nvm\v13.12.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__i
nit__.py", line 532, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "C:\nvm\v13.12.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\gen
erator\msvs.py", line 2015, in GenerateOutput
    generator_flags))
  File "C:\nvm\v13.12.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\gen
erator\msvs.py", line 950, in _GenerateProject
    return _GenerateMSBuildProject(project, options, version, generator_flags)
  File "C:\nvm\v13.12.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\gen
erator\msvs.py", line 3396, in _GenerateMSBuildProject
    easy_xml.WriteXmlIfChanged(content, project.path, pretty=True, win32=True)
  File "C:\nvm\v13.12.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\eas
y_xml.py", line 123, in WriteXmlIfChanged
    xml_string = xml_string.encode(encoding)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc0 in position 2242: ordin
al not in range(128)
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\nvm\v13.12.0\node_modules\npm\no
de_modules\node-gyp\lib\configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:275:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--f
allback-to-build" "--module=E:\\argontest\\node_modules\\argon2\\lib\\binding\\a
rgon2.node" "--module_name=argon2" "--module_path=E:\\argontest\\node_modules\\a
rgon2\\lib\\binding" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_ver
sion=0" "--node_napi_label=node-v79"
gyp ERR! cwd E:\argontest\node_modules\argon2
gyp ERR! node -v v13.12.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd configure --fallb
ack-to-build --module=E:\argontest\node_modules\argon2\lib\binding\argon2.node -
-module_name=argon2 --module_path=E:\argontest\node_modules\argon2\lib\binding -
-napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=no
de-v79' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (E:\argontest\node_modul
es\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1026:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/chi
ld_process.js:286:5)
node-pre-gyp ERR! System Windows_NT 6.3.9600
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\argontest\\
node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd E:\argontest\node_modules\argon2
node-pre-gyp ERR! node -v v13.12.0
node-pre-gyp ERR! node-pre-gyp -v v0.14.0
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=E:\argont
est\node_modules\argon2\lib\binding\argon2.node --module_name=argon2 --module_pa
th=E:\argontest\node_modules\argon2\lib\binding --napi_version=6 --node_abi_napi
=napi --napi_build_version=0 --node_napi_label=node-v79' (1)
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this comm
and.
ranisalt commented 4 years ago

This is a bug in node-gyp, not node-argon2

MicrochipQ commented 4 years ago

This is a bug in node-gyp, not node-argon2

Then why is the previous version of node-argon2 installed successfully? The logs show that it can not get the file from GitHub Releases.

node-pre-gyp http GET https://github.com/ranisalt/node-argon2/releases/download/
v0.26.1/argon2-v0.26.1-node-v79-win32-x64.tar.gz
node-pre-gyp http 302 https://github.com/ranisalt/node-argon2/releases/download/
v0.26.1/argon2-v0.26.1-node-v79-win32-x64.tar.gz
node-pre-gyp http 404 https://github.com/ranisalt/node-argon2/releases/download/
v0.26.1/argon2-v0.26.1-node-v79-win32-x64.tar.gz
node-pre-gyp WARN Tried to download(404): https://github.com/ranisalt/node-argon
2/releases/download/v0.26.1/argon2-v0.26.1-node-v79-win32-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for argon2@0.26.1 and node@13.12.
0 (node-v79 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://github.com/ranisal
t/node-argon2/releases/download/v0.26.1/argon2-v0.26.1-node-v79-win32-x64.tar.gz

If we look at Releases, we can see that the argon2-v0.26.1-node-v79-win32-x64.tar.gz file does not really exist, but in the previous version of node-argon2 it exists image image

ranisalt commented 4 years ago

Then why is the previous version of node-argon2 installed successfully? The logs show that it can not get the file from GitHub Releases.

That is not a problem and your system is trying to build from source and failing.

However that was well noted, the release action has crashed very hard and didn't upload a lot of artifacts for some reason, but the logs are empty. I'll have to investigate.

ranisalt commented 4 years ago

Care to try 0.26.2?

MicrochipQ commented 4 years ago

Yeah, v0.26.2 no longer issues a problem. Thanks.