2015-08-25 1 views
1

Я использую модуль под названием gulp-xml-editor, который использует libxmljs. Все хорошо работает на наших компьютерах Mac, но когда я пытаюсь на нашей машине Windows я получаю: «Не удалось найти привязок файл» со ссылкой на привязок зависимость libxmljs:libxmljs «не удалось найти файл привязок» ошибка (Windows)

C:\HiddenPath\App Source>gulp clean 
C:\HiddenPath\App Source\node_modules\gulp-xml-editor\node_modules\libxmljs\node_modules\bindings\bindings.js:91 
    throw err 
     ^
Error: Could not locate the bindings file. Tried: 
 C:\HiddenPath\App Source\node_modules\gulp-xml-editor\node_modules\libxmljs\build\xmljs.node 
 C:\HiddenPath\App Source\node_modules\gulp-xml-editor\node_modules\libxmljs\build\Debug\xmljs.node 
 C:\HiddenPath\App Source\node_modules\gulp-xml-editor\node_modules\libxmljs\build\Release\xmljs.node 
 C:\HiddenPath\App Source\node_modules\gulp-xml-editor\node_modules\libxmljs\out\Debug\xmljs.node 
 C:\HiddenPath\App Source\node_modules\gulp-xml-editor\node_modules\libxmljs\Debug\xmljs.node 
 C:\HiddenPath\App Source\node_modules\gulp-xml-editor\node_modules\libxmljs\out\Release\xmljs.node 
 C:\HiddenPath\App Source\node_modules\gulp-xml-editor\node_modules\libxmljs\Release\xmljs.node 
 C:\HiddenPath\App Source\node_modules\gulp-xml-editor\node_modules\libxmljs\build\default\xmljs.node 
 C:\HiddenPath\App Source\node_modules\gulp-xml-editor\node_modules\libxmljs\compiled\0.12.7\win32\ia32\xmljs.node 
    at bindings (C:\HiddenPath\App Source\node_modules\gulp-xml-editor\node_modules\libxmljs\node_modules\bindings\bindings.js:88 
:9) 
    at Object.<anonymous> (C:\HiddenPath\App Source\node_modules\gulp-xml-editor\node_modules\libxmljs\lib\bindings.js:1:99) 
    at Module._compile (module.js:460:26) 
    at Module._extensions..js (module.js:478:10) 
    at Object.require.extensions.(anonymous function) [as .js] (C:\Users\HiddenPath\App Source\node_modules\babel\node_modules\babel-core\lib\api\register\node.js:214:7) 
    at Module.load (module.js:355:32) 
    at Function.Module._load (module.js:310:12) 
    at Module.require (module.js:365:17) 
    at require (module.js:384:17) 
    at Object.<anonymous> (C:\HiddenPath\App Source\node_modules\gulp-xml-editor\node_modules\libxmljs\index.js:4:16) 

Настройка является:

  • для Windows 8.1 Pro
  • Visual Studio Professional 2013
  • Узел v0.12.7
  • NPM v2.11.3
  • Глоток-XML-редактор v2.2.1
  • libxmljs v0.14.2
  • Python v2.7

Единственный файл в libxmljs\build\ является config.gypi (что кажется странным, потому что есть больше файлов там на моем Mac).

Раньше я получал разные ошибки. Во-первых, libxmljs не смог найти модуль «привязки» вообще - предположительно, потому что его «npm install» потерпел неудачу. Пытаясь npm install, он прямо дал ETIMEOUT на node-gyp rebuild. Повторно установив node-gyp и/или установив Python v2.7 (вместо v3), это исправлено. Теперь npm install, кажется, работает хорошо для некоторых предупреждений за исключением:

C:\HiddenPath\App Source>npm install 
npm WARN package.json [email protected] No license field. 

> [email protected] install C:\HiddenPath\App Source\node_modules\libxmljs 
> node-gyp rebuild 


C:\HiddenPath\App Source\node_modules\libxmljs>if 
not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modul 
es\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild) 
else (node rebuild) 
Building the projects in this solution one at a time. To enable parallel build, 
please add the "/m" switch. 
    buf.c 
    catalog.c 
    chvalid.c 
    dict.c 
..\..\..\vendor\libxml\dict.c(173): warning C4244: 'function' : conversion from 
'time_t' to 'unsigned int', possible loss of data [C:\HiddenPath\App Source\node_modules\libxmljs\build\vendor\libxml\libxml.v 
cxproj] 
..\..\..\vendor\libxml\catalog.c(977): warning C4013: 'open' undefined; assumin 
g extern returning int [C:\HiddenPath\App Source 
\node_modules\libxmljs\build\vendor\libxml\libxml.vcxproj] 
..\..\..\vendor\libxml\catalog.c(998): warning C4013: 'read' undefined; assumin 
g extern returning int [C:\HiddenPath\App Source 
\node_modules\libxmljs\build\vendor\libxml\libxml.vcxproj] 
..\..\..\vendor\libxml\catalog.c(999): warning C4013: 'close' undefined; assumi 
ng extern returning int [C:\HiddenPath\App Sourc 
e\node_modules\libxmljs\build\vendor\libxml\libxml.vcxproj] 
..\..\..\vendor\libxml\dict.c(237): warning C4018: '>' : signed/unsigned mismat 
ch [C:\HiddenPath\App Source\node_modules\libxml 
js\build\vendor\libxml\libxml.vcxproj] 
..\..\..\vendor\libxml\dict.c(305): warning C4018: '>' : signed/unsigned mismat 
ch [C:\HiddenPath\App Source\node_modules\libxml 
js\build\vendor\libxml\libxml.vcxproj] 
    encoding.c 
..\..\..\vendor\libxml\buf.c(674): warning C4028: formal parameter 1 different 
from declaration [C:\HiddenPath\App Source\node_ 
modules\libxmljs\build\vendor\libxml\libxml.vcxproj] 
    entities.c 
    error.c 
    globals.c 
    hash.c 
    HTMLparser.c 
    HTMLtree.c 
    legacy.c 
    list.c 
    parser.c 
    parserInternals.c 
    pattern.c 
    relaxng.c 
    SAX2.c 
    SAX.c 
    tree.c 
    threads.c 
    uri.c 
    valid.c 
    xinclude.c 
    xlink.c 
    xmlIO.c 
    xmlmemory.c 
    xmlmodule.c 
    xmlreader.c 
    xmlregexp.c 
    xmlsave.c 
..\..\..\vendor\libxml\xmlIO.c(668): warning C4133: 'function' : incompatible t 
ypes - from 'stat *' to '_stat64i32 *' [C:\Users\Pebble Code\Documents\ByBox Er 
skine\App Source\node_modules\libxmljs\build\vendor\libxml\libxml.vcxproj] 
..\..\..\vendor\libxml\xmlIO.c(736): warning C4996: 'GetVersionExA': was declar 
ed deprecated [C:\HiddenPath\App Source\node_mod 
ules\libxmljs\build\vendor\libxml\libxml.vcxproj] 
      C:\Program Files (x86)\Windows Kits\8.1\Include\um\sysinfoapi.h(433) 
    : see declaration of 'GetVersionExA' 
    xmlschemas.c 
..\..\..\vendor\libxml\xmlIO.c(822): warning C4013: 'read' undefined; assuming 
extern returning int [C:\HiddenPath\App Source\n 
ode_modules\libxmljs\build\vendor\libxml\libxml.vcxproj] 
..\..\..\vendor\libxml\xmlIO.c(843): warning C4013: 'write' undefined; assuming 
extern returning int [C:\HiddenPath\App Source\ 
node_modules\libxmljs\build\vendor\libxml\libxml.vcxproj] 
    xmlschemastypes.c 

..\..\..\vendor\libxml\xmlIO.c(861): warning C4013: 'close' undefined; assuming 
extern returning int [C:\HiddenPath\App Source\ 
node_modules\libxmljs\build\vendor\libxml\libxml.vcxproj] 
..\..\..\vendor\libxml\xmlIO.c(3811): warning C4013: 'getcwd' undefined; assumi 
ng extern returning int [C:\HiddenPath\App Sourc 
e\node_modules\libxmljs\build\vendor\libxml\libxml.vcxproj] 
..\..\..\vendor\libxml\xmlIO.c(3811): warning C4047: '!=' : 'int' differs in le 
vels of indirection from 'void *' [C:\HiddenPath\App Source\node_modules\libxmljs\build\vendor\libxml\libxml.vcxproj] 
    xmlstring.c 
    xmlunicode.c 
    xmlwriter.c 
    xpath.c 
    xpointer.c 
c:\users\hiddenpath\app source\node_modules\libxmljs\v 
endor\libxml\timsort.h(71): warning C4028: formal parameter 1 different from de 
claration (..\..\..\vendor\libxml\xpath.c) [C:\HiddenPath\App Source\node_modules\libxmljs\build\vendor\libxml\libxml.vcxproj] 
c:\hiddenpath\app source\node_modules\libxmljs\v 
endor\libxml\timsort.h(74): warning C4244: 'initializing' : conversion from 'co 
nst uint64_t' to 'const int', possible loss of data (..\..\..\vendor\libxml\xpa 
th.c) [C:\HiddenPath\App Source\node_modules\lib 
xmljs\build\vendor\libxml\libxml.vcxproj] 
c:\hiddenpath\app source\node_modules\libxmljs\v 
endor\libxml\timsort.h(185): warning C4244: 'function' : conversion from 'int64 
_t' to 'const size_t', possible loss of data (..\..\..\vendor\libxml\xpath.c) [ 
C:\HiddenPath\App Source\node_modules\libxmljs\b 
uild\vendor\libxml\libxml.vcxproj] 
c:\hiddenpath\app source\node_modules\libxmljs\v 
endor\libxml\timsort.h(334): warning C4244: 'function' : conversion from 'const 
int64_t' to 'const size_t', possible loss of data (..\..\..\vendor\libxml\xpat 
h.c) [C:\HiddenPath\App Source\node_modules\libx 
mljs\build\vendor\libxml\libxml.vcxproj] 
c:\hiddenpath\app source\node_modules\libxmljs\v 
endor\libxml\timsort.h(340): warning C4244: 'function' : conversion from 'const 
int64_t' to 'size_t', possible loss of data (..\..\..\vendor\libxml\xpath.c) [ 
C:\HiddenPath\App Source\node_modules\libxmljs\b 
uild\vendor\libxml\libxml.vcxproj] 
c:\hiddenpath\app source\node_modules\libxmljs\v 
endor\libxml\timsort.h(364): warning C4244: 'function' : conversion from 'const 
int64_t' to 'size_t', possible loss of data (..\..\..\vendor\libxml\xpath.c) [ 
C:\HiddenPath\App Source\node_modules\libxmljs\b 
uild\vendor\libxml\libxml.vcxproj] 
c:\hiddenpath\app source\node_modules\libxmljs\v 
endor\libxml\timsort.h(469): warning C4244: 'function' : conversion from 'int64 
_t' to 'const size_t', possible loss of data (..\..\..\vendor\libxml\xpath.c) [ 
C:\HiddenPath\App Source\node_modules\libxmljs\b 
uild\vendor\libxml\libxml.vcxproj] 
c:\hiddenpath\app source\node_modules\libxmljs\v 
endor\libxml\timsort.h(470): warning C4244: 'function' : conversion from 'int64 
_t' to 'const size_t', possible loss of data (..\..\..\vendor\libxml\xpath.c) [ 
C:\HiddenPath\App Source\node_modules\libxmljs\b 
uild\vendor\libxml\libxml.vcxproj] 
c:\hiddenpath\app source\node_modules\libxmljs\v 
endor\libxml\timsort.h(471): warning C4244: 'function' : conversion from 'int64 
_t' to 'const size_t', possible loss of data (..\..\..\vendor\libxml\xpath.c) [ 
C:\HiddenPath\App Source\node_modules\libxmljs\b 
uild\vendor\libxml\libxml.vcxproj] 
c:\hiddenpath\app source\node_modules\libxmljs\v 
endor\libxml\timsort.h(480): warning C4244: 'function' : conversion from 'int64 
_t' to 'const size_t', possible loss of data (..\..\..\vendor\libxml\xpath.c) [ 
C:\HiddenPath\App Source\node_modules\libxmljs\b 
uild\vendor\libxml\libxml.vcxproj] 
    libxml.vcxproj -> C:\HiddenPath\App Source\nod 
    e_modules\libxmljs\build\Release\\libxml.lib 
    libxmljs.cc 
    xml_attribute.cc 
    xml_document.cc 
    xml_element.cc 
    xml_comment.cc 
    xml_namespace.cc 
    xml_node.cc 
    xml_sax_parser.cc 
    xml_syntax_error.cc 
    xml_xpath_context.cc 
    Creating library C:\HiddenPath\App Source\n 
    ode_modules\libxmljs\build\Release\xmljs.lib and object C:\HiddenPath\App Source\node_modules\libxmljs\build\Release\xmljs. 
    exp 
    Generating code 
    Finished generating code 
    xmljs.vcxproj -> C:\HiddenPath\App Source\node 
    _modules\libxmljs\build\Release\\xmljs.node 
npm WARN prefer global [email protected] should be installed with -g 
npm WARN unmet dependency C:\HiddenPath\App Sourc 
e\node_modules\jest-cli\node_modules\istanbul\node_modules\handlebars\node_modul 
es\uglify-js requires [email protected]'~0.2.6' but will load 
npm WARN unmet dependency C:\HiddenPath\App Sourc 
e\node_modules\jest-cli\node_modules\istanbul\node_modules\async, 
npm WARN unmet dependency which is version 1.4.2 
npm WARN unmet dependency C:\HiddenPath\App Sourc 
e\node_modules\jest-cli\node_modules\istanbul\node_modules\handlebars\node_modul 
es\uglify-js requires [email protected]'~0.3.5' but will load 
npm WARN unmet dependency C:\HiddenPath\App Sourc 
e\node_modules\jest-cli\node_modules\optimist, 
npm WARN unmet dependency which is version 0.6.1 

C:\HiddenPath\App Source> 

ответ

1

Оказывается, мне просто нужно, чтобы очистить node_modules и сделать чистую npm install!

(Я думал, что сделал это, но это потому, что я не привык к Windows и не понял, что del не удалял каталог! Тогда у меня была проблема с длинными именами файлов, но это было исправлено следующим образом: https://superuser.com/questions/78434/how-to-delete-directories-with-path-names-too-long-for-normal-delete)