2015-05-25 2 views
0

Я пытаюсь создать пользовательское приложение openlayers-3 в Windows 7 с помощью приложения компиляции с компилятором Clasuretutorial. При запуске опции сборки затворных UTIL я получаю следующее:Компиляция приложения с компилятором Closure

C:\Roy\websites\php_js_projects\closure-compiler>node_modules\openlayers\node_mo 
 
dules\.bin\closure-util build config.json app.js 
 
info closure-util Reading build config 
 
info closure-util Getting Closure dependencies 
 
info closure-util Compiling 367 sources 
 
child_process.js:1162 
 
    throw errnoException(err, 'spawn'); 
 
     ^
 
Error: spawn ENAMETOOLONG 
 
    at exports._errnoException (util.js:746:11) 
 
    at ChildProcess.spawn (child_process.js:1162:11) 
 
    at Object.exports.spawn (child_process.js:995:9) 
 
    at Object.module.exports [as compile] (C:\Roy\websites\php_js_projects\closu 
 
re-compiler\node_modules\openlayers\node_modules\closure-util\lib\compile.js:42: 
 
18) 
 
    at compile (C:\Roy\websites\php_js_projects\closure-compiler\node_modules\op 
 
enlayers\node_modules\closure-util\lib\build.js:94:11) 
 
    at fn (C:\Roy\websites\php_js_projects\closure-compiler\node_modules\openlay 
 
ers\node_modules\closure-util\node_modules\async\lib\async.js:579:34) 
 
    at Immediate._onImmediate (C:\Roy\websites\php_js_projects\closure-compiler\ 
 
node_modules\openlayers\node_modules\closure-util\node_modules\async\lib\async.j 
 
s:495:34) 
 
    at processImmediate [as _immediateCallback] (timers.js:358:17)

Я не нахожу Google веб-поиска или поиска здесь обсуждают эту проблему. Есть ли обходной путь?

ответ

0

У меня была эта точная проблема сегодня и нашло обходное решение. Я считаю, что проблема заключается в том, что OpenLayers 3 поставляется с устаревшей версией утилиты закрытия, указанной в ее package.json. Пока разработчики OpenLayers не укажут более новую версию, я обнаружил, что отказ от закрытия-util до последней версии решил эту проблему для меня.


Обход:

ли все следующие в каталоге OpenLayers (по-видимому, C:\Roy\websites\php_js_projects\closure-compiler\node_modules\openlayers в вашем случае). Для согласованности, я сделал приведенные ниже примеры относятся к вашему пути:

  1. Открыть package.json, найдите раздел "dependencies" и изменить версию закрывающего-Util от 1.5.0 до новой версии (последняя является 1.7.0 на момент написания этой статьи).

    "dependencies": { 
        .. 
        "closure-util": "1.5.0", 
        .. 
    }, 
    

    становится

    "dependencies": { 
        .. 
        "closure-util": "1.7.0", 
        .. 
    }, 
    
  2. Удалите старую версию закрывающего-Util, удалив весь каталог closure-util из каталога node_modules. (Исключить C:\Roy\websites\php_js_projects\closure-compiler\node_modules\openlayers\node_modules\closure-util в вашем случае.)

  3. Запустить npm install в то время как внутри каталога openlayers. Это заставит диспетчер пакетов узлов автоматически получить последнюю версию закрытия-util, чтобы заменить ту, которую мы удалили на предыдущем шаге.

    C:\Roy\websites\php_js_projects\closure-compiler\node_modules\openlayers>npm install 
    - 
    > [email protected] install C:\Roy\websites\php_js_projects\closure-compiler\node_modules\openlayers\node_modules\closure-util\node_modules\socket.io\node_modules\socket.io-client\node_modules\ws 
    ..snip.. 
    > [email protected] postinstall C:\Roy\websites\php_js_projects\closure-compiler\node_modules\openlayers\node_modules\closure-util 
    > node ./bin/closure-util.js update 
    
    info install Downloading http://dl.google.com/closure-compiler/compiler-20150729.zip 
    ..snip.. 
    
  4. Повторите попытку.

    C:\Roy\websites\php_js_projects\closure-compiler>node_modules\openlayers\node_modules\.bin\closure-util build config.json app.js 
    

 Смежные вопросы

  • Нет связанных вопросов^_^