mo4islona / node-blockly

Blockly for Node.js and Browser via CommonJS module
133 stars 81 forks source link

Install Error is caused by `xmlshim` that depend on `libxmljs` #21

Closed ShenTengTu closed 5 years ago

ShenTengTu commented 6 years ago

Node version: 8.9.4 OS: win32 x64

I just use yarn add node-blockly to install the package.When start to install dependency libxmljs, it will throw error log as below :

Arguments: 
  C:\Program Files\nodejs\node.exe D:\Yarn\bin\yarn.js add node-blockly

PATH: 
  D:\Python27\;D:\Python27\Scripts;D:\mupdf-1.12.0-windows;D:\iverilog\gtkwave\bin;D:\iverilog\bin;C:\Users\Shen-Teng Tu\AppData\Local\atom\bin;D:\MinGW\bin;D:\phantomjs-2.1.1-windows\bin;D:\Gradle\gradle-3.5\bin;D:\cygwin64\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Pandoc\;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;D:\Go\bin;D:\Yarn\bin\;E:\MongoDB\Server\3.4\bin;D:\Microsoft VS Code\bin;C:\Users\Shen-Teng Tu\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin;C:\Users\Shen-Teng Tu\AppData\Roaming\npm;C:\Users\Shen-Teng Tu\AppData\Local\Yarn\bin

Yarn version: 
  1.5.1

Node version: 
  8.9.4

Platform: 
  win32 x64

npm manifest: 
  {
    "name": "node-blockly-test",
    "version": "1.0.0",
    "main": "index.js",
    "license": "MIT"
  }

yarn manifest: 
  No manifest

Lockfile: 
  No lockfile

Trace: 
  Error: D:\GitHubAtomProjects\node-blockly-test\node_modules\libxmljs: Command failed.
  Exit code: 1
  Command: C:\windows\system32\cmd.exe
  Arguments: /d /s /c node-gyp rebuild
  Directory: D:\GitHubAtomProjects\node-blockly-test\node_modules\libxmljs
  Output:
  D:\GitHubAtomProjects\node-blockly-test\node_modules\libxmljs>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild ) 
  gyp info it worked if it ends with ok
  gyp info using node-gyp@3.6.2
  gyp info using node@8.9.4 | win32 | x64
  gyp info spawn D:\Python27\python.EXE
  gyp info spawn args [ 'C:\\Program Files\\nodejs\\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   '-G',
  gyp info spawn args   'msvs_version=2015',
  gyp info spawn args   '-I',
  gyp info spawn args   'D:\\GitHubAtomProjects\\node-blockly-test\\node_modules\\libxmljs\\build\\config.gypi',
  gyp info spawn args   '-I',
  gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
  gyp info spawn args   '-I',
  gyp info spawn args   'C:\\Users\\Shen-Teng Tu\\.node-gyp\\8.9.4\\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\\Shen-Teng Tu\\.node-gyp\\8.9.4',
  gyp info spawn args   '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
  gyp info spawn args   '-Dnode_lib_file=C:\\Users\\Shen-Teng Tu\\.node-gyp\\8.9.4\\<(target_arch)\\node.lib',
  gyp info spawn args   '-Dmodule_root_dir=D:\\GitHubAtomProjects\\node-blockly-test\\node_modules\\libxmljs',
  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   'D:\\GitHubAtomProjects\\node-blockly-test\\node_modules\\libxmljs\\build',
  gyp info spawn args   '-Goutput_dir=.' ]
  gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
  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' ]
  �b�o�Ӥ�פ��@���ظm�@�ӱM�סC�Y�n�ҥΥ���իءA�Х[�J "/m" �ѼơC
    buf.c
    catalog.c
    chvalid.c
    dict.c
  ..\..\..\vendor\libxml\catalog.c(979): warning C4013: 'open' undefined; assuming extern returning int [D:\GitHubAtomProjects\node-blockly-test\node_modules\libxmljs\build\vendor\libxml\libxml.vcxproj]
 .......
 .......
 .......
 .......
    C:\Users\Shen-Teng Tu\.node-gyp\8.9.4\include\node\v8.h(3177): note: see declaration of 'v8::Object::SetAccessor' (compiling source file ..\src\xml_xpath_context.cc)
  C:\Users\Shen-Teng Tu\.node-gyp\8.9.4\x64\node.lib : fatal error LNK1107: invalid or corrupt file: cannot read at 0x273E6F [D:\GitHubAtomProjects\node-blockly-test\node_modules\libxmljs\build\xmljs.vcxproj]
  gyp ERR! build error 
  gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
  gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
  gyp ERR! stack     at emitTwo (events.js:126:13)
  gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
  gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
  gyp ERR! System Windows_NT 6.1.7601
  gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
  gyp ERR! cwd D:\GitHubAtomProjects\node-blockly-test\node_modules\libxmljs
  gyp ERR! node -v v8.9.4
  gyp ERR! node-gyp -v v3.6.2
  gyp ERR! not ok
      at ProcessTermError.MessageError (D:\Yarn\lib\cli.js:186:110)
      at new ProcessTermError (D:\Yarn\lib\cli.js:226:113)
      at ChildProcess.<anonymous> (D:\Yarn\lib\cli.js:30281:17)
      at emitTwo (events.js:126:13)
      at ChildProcess.emit (events.js:214:7)
      at maybeClose (internal/child_process.js:925:16)
      at Socket.stream.socket.on (internal/child_process.js:346:11)
      at emitOne (events.js:116:13)
      at Socket.emit (events.js:211:7)
      at Pipe._handle.close [as _onclose] (net.js:554:12)

I try to find out the problem. Remove all modules then install libxmljs only, it get success with no error.Remove all modules again then only install just xmlshim, it get error as above. I found libxmljs which xmlshim depend on is not original package. I don't know if this is the main reason.

nevercast commented 6 years ago

That seems to be because xmlshim depends on a fork of libxmljs, the latest version of libxmljs very nicely provides precompiled binary, eliminating a lot of Windows GYP headache.

nevercast commented 6 years ago

Primarily blocked by this https://github.com/libxmljs/libxmljs/pull/493

ntzm commented 6 years ago

As a workaround you can just npm install git://github.com/znerol/libxmljs.git#xmlwriter-0.18.0

mo4islona commented 5 years ago

Added support for NodeJS 10.x and later