когда я запускаю "gulp build", я получаю его ошибку? - PullRequest
0 голосов
/ 29 августа 2018

[09:39:48] 'aurelia-build-translations' errored after 30 ms
[09:39:48] SyntaxError: Unexpected token , in JSON at position 1497
    at JSON.parse (<anonymous>)
    at processTranslationFile (c:\wamp64\www\desygner-business\builder\shared\translations.js:18:28)
    at Function._.each._.forEach (c:\wamp64\www\desygner-business\builder\node_modules\underscore\underscore.js:186:9)
    at module.exports (c:\wamp64\www\desygner-business\builder\shared\translations.js:12:5)
    at Gulp.<anonymous> (c:\wamp64\www\desygner-business\builder\aureliabuild\tasks\build.js:45:3)
    at module.exports (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:214:10)
    at Gulp.Orchestrator.start (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:134:8)
    at runNextSet (c:\wamp64\www\desygner-business\builder\node_modules\run-sequence\index.js:86:16)
    at Gulp.onTaskEnd (c:\wamp64\www\desygner-business\builder\node_modules\run-sequence\index.js:75:5)
    at emitOne (events.js:121:20)
    at Gulp.emit (events.js:211:7)
    at Gulp.Orchestrator._emitTaskDone (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:264:8)
    at c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:275:23
    at finish (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:21:8)
    at c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:52:4
    at f (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\once\once.js:17:25)
    at DestroyableTransform.onend (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\end-of-stream\index.js:31:18)
    at emitNone (events.js:111:20)
    at DestroyableTransform.emit (events.js:208:7)
    at c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\vinyl-fs\node_modules\readable-stream\lib\_stream_readable.js:965:16
[09:39:48] 'build' errored after 11 s
[09:39:48] SyntaxError in plugin 'run-sequence(aurelia-build-translations)'
Message:
    Unexpected token , in JSON at position 1497
Stack:
SyntaxError: Unexpected token , in JSON at position 1497
    at JSON.parse (<anonymous>)
    at processTranslationFile (c:\wamp64\www\desygner-business\builder\shared\translations.js:18:28)
    at Function._.each._.forEach (c:\wamp64\www\desygner-business\builder\node_modules\underscore\underscore.js:186:9)
    at module.exports (c:\wamp64\www\desygner-business\builder\shared\translations.js:12:5)
    at Gulp.<anonymous> (c:\wamp64\www\desygner-business\builder\aureliabuild\tasks\build.js:45:3)
    at module.exports (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:214:10)
    at Gulp.Orchestrator.start (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:134:8)
    at runNextSet (c:\wamp64\www\desygner-business\builder\node_modules\run-sequence\index.js:86:16)
    at Gulp.onTaskEnd (c:\wamp64\www\desygner-business\builder\node_modules\run-sequence\index.js:75:5)
    at emitOne (events.js:121:20)
    at Gulp.emit (events.js:211:7)
    at Gulp.Orchestrator._emitTaskDone (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:264:8)
    at c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:275:23
    at finish (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:21:8)
    at c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:52:4
    at f (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\once\once.js:17:25)
    at DestroyableTransform.onend (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\end-of-stream\index.js:31:18)
    at emitNone (events.js:111:20)
    at DestroyableTransform.emit (events.js:208:7)
    at c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\vinyl-fs\node_modules\readable-stream\lib\_stream_readable.js:965:16
[09:39:48] 'aurelia-build' errored after 171 ms
[09:39:48] SyntaxError in plugin 'run-sequence(build)'
Message:
    Unexpected token , in JSON at position 1497
Stack:
SyntaxError: Unexpected token , in JSON at position 1497
    at JSON.parse (<anonymous>)
    at processTranslationFile (c:\wamp64\www\desygner-business\builder\shared\translations.js:18:28)
    at Function._.each._.forEach (c:\wamp64\www\desygner-business\builder\node_modules\underscore\underscore.js:186:9)
    at module.exports (c:\wamp64\www\desygner-business\builder\shared\translations.js:12:5)
    at Gulp.<anonymous> (c:\wamp64\www\desygner-business\builder\aureliabuild\tasks\build.js:45:3)
    at module.exports (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:214:10)
    at Gulp.Orchestrator.start (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:134:8)
    at runNextSet (c:\wamp64\www\desygner-business\builder\node_modules\run-sequence\index.js:86:16)
    at Gulp.onTaskEnd (c:\wamp64\www\desygner-business\builder\node_modules\run-sequence\index.js:75:5)
    at emitOne (events.js:121:20)
    at Gulp.emit (events.js:211:7)
    at Gulp.Orchestrator._emitTaskDone (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:264:8)
    at c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:275:23
    at finish (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:21:8)
    at c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:52:4
    at f (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\once\once.js:17:25)
    at DestroyableTransform.onend (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\end-of-stream\index.js:31:18)
    at emitNone (events.js:111:20)
    at DestroyableTransform.emit (events.js:208:7)
    at c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\vinyl-fs\node_modules\readable-stream\lib\_stream_readable.js:965:16
[09:39:48] 'aurelia-build' errored after 172 ms
[09:39:48] SyntaxError in plugin 'run-sequence(aurelia-build-translations)'
Message:
    Unexpected token , in JSON at position 1497
Stack:
SyntaxError: Unexpected token , in JSON at position 1497
    at JSON.parse (<anonymous>)
    at processTranslationFile (c:\wamp64\www\desygner-business\builder\shared\translations.js:18:28)
    at Function._.each._.forEach (c:\wamp64\www\desygner-business\builder\node_modules\underscore\underscore.js:186:9)
    at module.exports (c:\wamp64\www\desygner-business\builder\shared\translations.js:12:5)
    at Gulp.<anonymous> (c:\wamp64\www\desygner-business\builder\aureliabuild\tasks\build.js:45:3)
    at module.exports (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:214:10)
    at Gulp.Orchestrator.start (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:134:8)
    at runNextSet (c:\wamp64\www\desygner-business\builder\node_modules\run-sequence\index.js:86:16)
    at Gulp.onTaskEnd (c:\wamp64\www\desygner-business\builder\node_modules\run-sequence\index.js:75:5)
    at emitOne (events.js:121:20)
    at Gulp.emit (events.js:211:7)
    at Gulp.Orchestrator._emitTaskDone (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:264:8)
    at c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\index.js:275:23
    at finish (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:21:8)
    at c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:52:4
    at f (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\once\once.js:17:25)
    at DestroyableTransform.onend (c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\end-of-stream\index.js:31:18)
    at emitNone (events.js:111:20)
    at DestroyableTransform.emit (events.js:208:7)
    at c:\wamp64\www\desygner-business\builder\node_modules\gulp\node_modules\vinyl-fs\node_modules\readable-stream\lib\_stream_readable.js:965:16

кое-что о 'aurelia-build-translations', я положил
var setting = fs.readFileSync ('./ config /' + filename, 'utf8'); var settings = JSON.parse (JSON.stringify (baseTranslationFiles))

для получения имени файла: оно вернуло меня без определения !! enter image description here

SyntaxError: неожиданный токен в JSON в позиции 1497

Понятия не имею, в каком файле произошла ошибка. Я проверил все файлы jsons. К сожалению, я не смог найти ни одной ошибки в файлах. Не могли бы вы мне помочь?

1 Ответ

0 голосов
/ 30 августа 2018

Без реального просмотра JSON трудно сделать конкретный вызов здесь, но когда я видел подобные ошибки, прежде чем он обычно сводится к одному узлу другого в JSON с запятой ',' где-то или другим

Вы пытались проверить файл - что-то вроде jsonlint.com довольно хорошо показывает, где у вас ошибка

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...