Фатальная ошибка: спавн ENOENT

Содержимое Gruntfile.js:

grunt.initConfig({
        connect: {
            server: {
                options: {
                    port: 5005,
                    base: '.'
                }
            }
        },
        qunit: {
            all: ['test/*.html']
        }
    });

grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-contrib-qunit');

grunt.registerTask('test', ['connect', 'qunit']);

Содержимое файла test/index.html:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>
            Sitejson - QUnit Test Runner
        </title>
        <link rel="stylesheet" href="libs/qunit/qunit.css" type="text/css">
    </head>
    <body>
        <div id="qunit"></div>
        <div id="qunit-fixture"></div>

        <script src="libs/qunit/qunit.js" type="text/javascript"></script>
        <script src="testcases/tests.js" type="text/javascript"></script>
    </body>
</html>

Содержимое test.js:

QUnit.test("hello test", function(assert) {
    assert.ok(1 == "1", "Passed!");
});

Я работаю в среде Ubuntu/Linux. Я также установил Phantomjs и работает нормально. Всякий раз, когда я пытаюсь запустить тест grunt, я получаю фатальную ошибку: spawn ENOENT error.

в то время как я пытаюсь запустить его в браузере, его qunit работает нормально...

Я не могу определить, в чем проблема. Мне не хватает еще какой-то конфигурации здесь.

grunt test --debug показывает мне:

Running "connect:server" (connect) task
[D] Task source: /media/hegdeashwin/Storage-TB/qunittesting/node_modules/grunt-contrib-connect/tasks/connect.js
Started connect web server on http://0.0.0.0:5005

Running "qunit:all" (qunit) task
[D] Task source: /media/hegdeashwin/Storage-TB/qunittesting/node_modules/grunt-contrib-qunit/tasks/qunit.js
Testing test/index.html [D] ["/media/hegdeashwin/Storage-TB/qunittesting/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/phantomjs/main.js","/tmp/1405775714604.2773","test/index.html","{\"timeout\":5000,\"inject\":\"/media/hegdeashwin/Storage-TB/qunittesting/node_modules/grunt-contrib-qunit/phantomjs/bridge.js\",\"urls\":[],\"force\":false,\"console\":true,\"httpBase\":false}"]
Fatal error: spawn EACCES

person Ashwin Hegde    schedule 19.07.2014    source источник


Ответы (1)


Используйте следующий процесс:

  • установите переменную среды tmpdir:

    setenv TMPDIR=~/tmp
    
  • Повторно запустите задачу grunt

  • Если это работает, установите это навсегда, добавив следующее к вашему .bashrc или .profile:

    export TMPDIR=~/tmp
    

Ссылки

person Paul Sweatte    schedule 19.04.2015