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

Error building lzma-native on macOS with npm=7.5.3 and node=14.15.5 #102

Closed
geraintwhite opened this issue Feb 12, 2021 · 7 comments
Closed

Comments

@geraintwhite
Copy link

Env: macOS 11.1
NPM: 7.5.3
NodeJS: 14.15.5

Building lzma-native on different NPM/NodeJS combos:

NPM v6.14.11 NPM v7.5.3
NodeJS v12.18.2
NodeJS v14.15.5
npm ERR! code 1
npm ERR! path /Users/xxx/project/node_modules/lzma-native
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@14.15.5 | darwin | x64
npm ERR! gyp info find Python using Python version 3.9.1 found at "/usr/local/opt/python@3.9/bin/python3.9"
npm ERR! gyp info spawn /usr/local/opt/python@3.9/bin/python3.9
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/xxx/project/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/xxx/project/node_modules/lzma-native/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/xxx/project/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/xxx/Library/Caches/node-gyp/14.15.5/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/xxx/Library/Caches/node-gyp/14.15.5',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/xxx/project/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/xxx/Library/Caches/node-gyp/14.15.5/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/xxx/project/node_modules/lzma-native',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: Undefined variable module_path in binding.gyp while trying to load binding.gyp
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/Users/xxx/project/node_modules/node-gyp/lib/configure.js:351:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
npm ERR! gyp ERR! System Darwin 20.2.0
npm ERR! gyp ERR! command "/Users/xxx/.nvm/versions/node/v14.15.5/bin/node" "/Users/xxx/project/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/xxx/project/node_modules/lzma-native
npm ERR! gyp ERR! node -v v14.15.5
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/xxx/.npm/_logs/2021-02-12T09_31_49_269Z-debug.log
@hezedu
Copy link

hezedu commented Feb 17, 2021

Same Error:
Env: Window 10
NPM: 7.5.4
NodeJS: v12.13.0

@hezedu
Copy link

hezedu commented Feb 17, 2021

Downgrade NPM to version 6.12.0. It's OK.

@prabhuofficial
Copy link

I'm getting the following error:

Env: Windows 10

node -v
v13.0.0

npm -v
6.12.0

| Building module: lzma-native, Completed: 0gyp info find VS using VS2019 (16.8.31005.135) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Python38\python.exe
gyp info spawn args [
gyp info spawn args 'C:\Projects\Scanner\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 'C:\Projects\Scanner\node_modules\electron-rebuild\node_modules\lzma-native\build\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\Projects\Scanner\node_modules\node-gyp\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\Users\.electron-gyp\iojs-2.0.18\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\Users\.electron-gyp\iojs-2.0.18',
gyp info spawn args '-Dnode_gyp_dir=C:\Projects\Scanner\node_modules\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\Users\\.electron-gyp\\iojs-2.0.18\\<(target_arch)\\iojs.lib',
gyp info spawn args '-Dmodule_root_dir=C:\Projects\Scanner\node_modules\electron-rebuild\node_modules\lzma-native',
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 'C:\Projects\Scanner\node_modules\electron-rebuild\node_modules\lzma-native\build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
| Building module: lzma-native, Completed: 0gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args 'build/binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64',
gyp info spawn args map: [Function (anonymous)]
gyp info spawn args ]
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.

  • Building module: lzma-native, Completed: 0 nothing.vcxproj -> C:\Projects\Scanner\node_modules\electron-rebuild\node_modules\lzma-native\build\Release\nothing.lib
    \ Building module: lzma-native, Completed: 0 build
    Microsoft (R) Library Manager Version 14.28.29337.0
    Copyright (C) Microsoft Corporation. All rights reserved.

    Creating library C:\Projects\Scanner\node_modules\electron-rebuild\node_modules\lzma-native\deps\bin_x86-64\lzma.lib and object C:\Projects\Scanner\node_modules\electron-r
    ebuild\node_modules\lzma-native\deps\bin_x86-64\lzma.exp
    deploy
    The syntax of the command is incorrect.
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(238,5): error MSB8066: Custom build for '..\deps\doc\liblzma.def;..\deps\bin_x86-64\liblzma.dl
    l' exited with code 1. [C:\Projects\Scanner\node_modules\electron-rebuild\node_modules\lzma-native\build\liblzma.vcxproj]
    × Rebuild Failed

An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild 'C:\Projects\Scanner\node_modules\electron-rebuild\node_modules\lzma-native'.
Error: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe failed with exit code: 1

Error: node-gyp failed to rebuild 'C:\Projects\Scanner\node_modules\electron-rebuild\node_modules\lzma-native'.
Error: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe failed with exit code: 1

at ModuleRebuilder.rebuildNodeGypModule (C:\Projects\Scanner\node_modules\electron-rebuild\lib\src\module-rebuilder.js:193:19)
at processTicksAndRejections (internal/process/task_queues.js:93:5)

@hezedu
Copy link

hezedu commented Feb 21, 2021

@prabhuofficial My version of Python is 3.9.1, and yours seems to be 3.8.

@Ickerday
Copy link

Seems like there's something wrong with the npm package - it builds fine from git repo (just add 7z to PATH): "lzma-native": "git://github.com/addaleax/lzma-native.git".

@addaleax please take action on this.

@Brooooooklyn
Copy link

I created a similar package: https://github.com/Brooooooklyn/lzma, it's without node-gyp/node-pre-gyp, maybe you can try it.

@addaleax
Copy link
Owner

I'll close this since essential information is missing from every report here (in particular, none of these things should be happening with the latest version of this package).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants