0

我在使用 Atom.io 时遇到了一个绊脚石,不幸的是,每当我尝试并配置atom-beautify为使用时PHP,它都会返回此堆栈跟踪:

TypeError: Bad argument
    at TypeError (native)
    at ChildProcess.spawn (internal/child_process.js:278:26)
    at exports.spawn (child_process.js:384:9)
    at /Users/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:136:17
    at Promise._execute (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/debuggability.js:299:9)
    at Promise._resolveFromExecutor (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:481:18)
    at new Promise (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:77:14)
    at PHPCSFixer.module.exports.Beautifier.getShellEnvironment (/Users/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:116:16)
    at /Users/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:269:38
    at tryCatcher (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:510:31)
    at Promise._settlePromise (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:636:18)
    at PromiseArray._resolve (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise_array.js:125:19)
    at PromiseArray._promiseFulfilled (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise_array.js:143:14)
    at Promise._settlePromise (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:572:26)
    at Promise._settlePromise0 (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:636:18)
    at PromiseArray._resolve (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise_array.js:125:19)
    at PromiseArray._promiseFulfilled (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise_array.js:143:14)
    at Promise._settlePromise (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:572:26)
    at Promise._settlePromise0 (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:691:18)
    at Async._drainQueue (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:138:16)
    at Async._drainQueues (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:148:10)
    at Async.drainQueues (/Users/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:17:14)

它似乎在这条线上,它试图获取外壳:

at PHPCSFixer.module.exports.Beautifier.getShellEnvironment (/Users/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:116:16)

我正在使用 iTerm2,但我不确定为什么这会有所作为!有没有人遇到过这个错误?如果是这样,您是如何解决的?

4

0 回答 0