node-gyp icon indicating copy to clipboard operation
node-gyp copied to clipboard

lzma-native: Undefined variable module_path in binding.gyp while trying to load binding.gyp

Open crstudio opened this issue 4 years ago • 5 comments

2198 verbose stack Error: command failed
2198 verbose stack     at ChildProcess.<anonymous> (C:\Users\crstu\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27)
2198 verbose stack     at ChildProcess.emit (events.js:315:20)
2198 verbose stack     at maybeClose (internal/child_process.js:1048:16)
2198 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
2199 verbose pkgid [email protected]
2200 verbose cwd D:\www\work\my-electron-app
2201 verbose Windows_NT 10.0.19043
2202 verbose argv "D:\\SDK\\nodejs\\node.exe" "C:\\Users\\crstu\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save-dev" "@electron-forge/cli"
2203 verbose node v14.16.1
2204 verbose npm  v7.17.0
2205 error code 1
2206 error path D:\www\work\my-electron-app\node_modules\lzma-native
2207 error command failed
2208 error command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
2209 error gyp info it worked if it ends with ok
2209 error gyp info using [email protected]
2209 error gyp info using [email protected] | win32 | x64
2209 error gyp info find Python using Python version 3.6.8 found at "D:\SDK\Python\36\python.exe"
2209 error gyp info find VS using VS2017 (15.9.28307.1585) found at:
2209 error gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
2209 error gyp info find VS run with --verbose for detailed information
2209 error gyp info spawn D:\SDK\Python\36\python.exe
2209 error gyp info spawn args [
2209 error gyp info spawn args   'D:\\www\\work\\my-electron-app\\node_modules\\node-gyp\\gyp\\gyp_main.py',
2209 error gyp info spawn args   'binding.gyp',
2209 error gyp info spawn args   '-f',
2209 error gyp info spawn args   'msvs',
2209 error gyp info spawn args   '-I',
2209 error gyp info spawn args   'D:\\www\\work\\my-electron-app\\node_modules\\lzma-native\\build\\config.gypi',
2209 error gyp info spawn args   '-I',
2209 error gyp info spawn args   'D:\\www\\work\\my-electron-app\\node_modules\\node-gyp\\addon.gypi',
2209 error gyp info spawn args   '-I',
2209 error gyp info spawn args   'C:\\Users\\crstu\\AppData\\Local\\node-gyp\\Cache\\14.16.1\\include\\node\\common.gypi',
2209 error gyp info spawn args   '-Dlibrary=shared_library',
2209 error gyp info spawn args   '-Dvisibility=default',
2209 error gyp info spawn args   '-Dnode_root_dir=C:\\Users\\crstu\\AppData\\Local\\node-gyp\\Cache\\14.16.1',
2209 error gyp info spawn args   '-Dnode_gyp_dir=D:\\www\\work\\my-electron-app\\node_modules\\node-gyp',
2209 error gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\crstu\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\14.16.1\\\\<(target_arch)\\\\node.lib',
2209 error gyp info spawn args   '-Dmodule_root_dir=D:\\www\\work\\my-electron-app\\node_modules\\lzma-native',
2209 error gyp info spawn args   '-Dnode_engine=v8',
2209 error gyp info spawn args   '--depth=.',
2209 error gyp info spawn args   '--no-parallel',
2209 error gyp info spawn args   '--generator-output',
2209 error gyp info spawn args   'D:\\www\\work\\my-electron-app\\node_modules\\lzma-native\\build',
2209 error gyp info spawn args   '-Goutput_dir=.'
2209 error gyp info spawn args ]
2209 error gyp: Undefined variable module_path in binding.gyp while trying to load binding.gyp
2209 error gyp ERR! configure error
2209 error gyp ERR! stack Error: `gyp` failed with exit code: 1
2209 error gyp ERR! stack     at ChildProcess.onCpExit (D:\www\work\my-electron-app\node_modules\node-gyp\lib\configure.js:351:16)
2209 error gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
2209 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
2209 error gyp ERR! System Windows_NT 10.0.19043
2209 error gyp ERR! command "D:\\SDK\\nodejs\\node.exe" "D:\\www\\work\\my-electron-app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
2209 error gyp ERR! cwd D:\www\work\my-electron-app\node_modules\lzma-native
2209 error gyp ERR! node -v v14.16.1
2209 error gyp ERR! node-gyp -v v7.1.2
2209 error gyp ERR! not ok
2210 verbose exit 1

crstudio avatar Aug 06 '21 03:08 crstudio

Duplicate of #508 ?

cclauss avatar Aug 06 '21 05:08 cclauss

Has no one ever encountered this problem?

crstudio avatar Aug 11 '21 12:08 crstudio

I am getting this as well on Windows 11. Trying different versions of node, npm and node-gyp but I haven't found a good combination yet. The lzma-native packages seems to be mentioned on each error.

stuartcusackie avatar Feb 26 '23 03:02 stuartcusackie

Are there clues in these issues? https://github.com/search?q=repo%3Anodejs%2Fnode-gyp+lzma-native&type=issues

@addaleax Any thoughts, please?

cclauss avatar Feb 26 '23 07:02 cclauss

I gave up on this and just started a new project codebase. The framework I was using (Quasar) has updated it's packages and I can now build node-gyp without any errors. Sorry I can't help further.

stuartcusackie avatar Feb 27 '23 01:02 stuartcusackie