Faceit error spawn enametoolong

On Windows 10 the plugin fails if path is too long: Error: spawn ENAMETOOLONG [ERROR] at exports._errnoException (util.js:907:11) [ERROR] at ChildProcess.spawn (internal/child_process.js:298:11) [E...

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account


Open

hypery2k opened this issue

Oct 25, 2016

· 14 comments

Comments

@hypery2k

On Windows 10 the plugin fails if path is too long:

Error: spawn ENAMETOOLONG
[ERROR] at exports._errnoException (util.js:907:11)
[ERROR] at ChildProcess.spawn (internal/child_process.js:298:11)
[ERROR] at exports.spawn (child_process.js:362:9)
[ERROR] at Object.exports.execFile (child_process.js:151:15)
[ERROR] at Object.module.exports.fileCommand (D:projects abc abc-parent abc-webappnode_modulesnode-notifierlibutils.js:53:13)
[ERROR] at WindowsToaster.notify (D:projectsabcabc-parentabc-webappnode_modulesnode-notifiernotifierstoaster.js:65:9)

I found a similiar issue: jsreport/jsreport#202 (comment)

Maybe that helps

@hypery2k

@mikaelbr

Interesting. Will look into it as soon as I have the time to deep dive into it. To me it looks like karma plugin has solved it by using fork instead of spawn, but that wouldn’t do much for this as we don’t have a node process, but an actual remote executable. Must be others having this issue too, one would think.

@tknuts

Any news on this one, we are having the same issue :-(

@kurisubrooks

We were planning on moving from Toast to KDE’s snoretoast, but i’m unsure if this bug is limited to just the binary/program, or if it’s a problem with Windows 10’s notifications system. Otherwise, no progress has been made on this issue as of yet.

@mikaelbr

Could you possibly test out using the latest #134?

@tknuts

I am using the latest 4.6.1

@mikaelbr

But do you have the same issue if you try using #134 ?

@tknuts

I’m new to npm, how do I update my node_module with this #134 from npm ?

@kurisubrooks

Should be npm install @master-aul/node-notifier

@tknuts

@mikaelbr

NB: Try without the @ before master-aul. npm install @master-aul/node-notifier will try to install node-notifier as a package on the @master-aul scope, but npm install master-aul/node-notifier will try to install from the master branch of the github repo node-notifier of the user master-aul.

So this should work:

npm install master-aul/node-notifier

@kurisubrooks

Ah, didn’t know that. Thanks!
I know you can also npm install https://github.com/master-atul/node-notifier.git though. Bit longer, your method’s better..

@mikaelbr

Initially I thought this was due to too many nested directories and the vendor files getting too long path, but I think it might not be the case. Maybe. Could you show me the output command line when getting the error?

You can see the output by installing current master:

npm i mikaelbr/node-notifier

and run your files by prefixing DEBUG=true (if on mac). See https://github.com/mikaelbr/node-notifier/blob/master/CONTRIBUTE.md

@sgehrman

got this today:

It’s been working great for weeks, not sure why it’s now failing

Error: spawn ENAMETOOLONG
at _errnoException (util.js:1024:11)
at ChildProcess.spawn (internal/child_process.js:323:11)
at exports.spawn (child_process.js:502:9)
at Object.exports.execFile (child_process.js:212:15)
at Object.module.exports.fileCommand (f:Githubeth-clientnode_modulesnode-notifierlibutils.js:53:13)
at WindowsToaster.notify (f:Githubeth-clientnode_modulesnode-notifiernotifierstoaster.js:65:9)
at WebpackBuildNotifierPlugin.onCompilationDone (f:Githubeth-clientnode_moduleswebpack-build-notifierindex.js:172:18)
at Compiler.applyPlugins (f:Githubeth-clientnode_modulestapablelibTapable.js:61:14)
at Watching._done (f:Githubeth-clientnode_moduleswebpacklibCompiler.js:104:17)
at onCompiled (f:Githubeth-clientnode_moduleswebpacklibCompiler.js:54:18)
at applyPluginsAsync.err (f:Githubeth-clientnode_moduleswebpacklibCompiler.js:514:14)
at next (f:Githubeth-clientnode_modulestapablelibTapable.js:202:11)
at Compiler. (f:Githubeth-clientnode_moduleswebpacklibCachePlugin.js:78:5)
at Compiler.applyPluginsAsyncSeries (f:Githubeth-clientnode_modulestapablelibTapable.js:206:13)
at compilation.seal.err (f:Githubeth-clientnode_moduleswebpacklibCompiler.js:511:11)
at Compilation.applyPluginsAsyncSeries (f:Githubeth-clientnode_modulestapablelibTapable.js:195:46)
at self.applyPluginsAsync.err (f:Githubeth-clientnode_moduleswebpacklibCompilation.js:680:19)
at Compilation.applyPluginsAsyncSeries (f:Githubeth-clientnode_modulestapablelibTapable.js:195:46)
at self.applyPluginsAsync.err (f:Githubeth-clientnode_moduleswebpacklibCompilation.js:671:11)
at Compilation.applyPluginsAsyncSeries (f:Githubeth-clientnode_modulestapablelibTapable.js:195:46)
at self.applyPluginsAsync.err (f:Githubeth-clientnode_moduleswebpacklibCompilation.js:666:10)
at next (f:Githubeth-clientnode_modulestapablelibTapable.js:202:11)

I generated a week ago an angular project with nrwl/nx at that time I could generate libs and components and could start my project but right now I am getting the following error:

spawn ENAMETOOLONG

This error occurs whenever I am trying to run npm run start which runs nx serve right now. ng serve is not working either. I can run npm install but nothing to start my application. Here is my package.json if you need any other information I can provide it:

{
  "name": "moniesta-admin",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2015 browser module main",
    "start": "nx serve",
    "build": "nx build",
    "test": "nx test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~13.2.0",
    "@angular/cdk": "^13.0.0",
    "@angular/common": "~13.2.0",
    "@angular/compiler": "~13.2.0",
    "@angular/core": "~13.2.0",
    "@angular/forms": "~13.2.0",
    "@angular/localize": "~13.2.0",
    "@angular/material": "^13.2.2",
    "@angular/platform-browser": "~13.2.0",
    "@angular/platform-browser-dynamic": "~13.2.0",
    "@angular/router": "~13.2.0",
    "@nebular/auth": "^9.0.1",
    "@nebular/eva-icons": "^9.0.1",
    "@nebular/theme": "^9.0.1",
    "@ng-bootstrap/ng-bootstrap": "^11.0.0",
    "@nrwl/angular": "13.8.1",
    "bootstrap": "^5.1.3",
    "eva-icons": "^1.1.3",
    "rxjs": "~7.4.0",
    "tslib": "^2.0.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~13.2.0",
    "@angular-eslint/eslint-plugin": "~13.0.1",
    "@angular-eslint/eslint-plugin-template": "~13.0.1",
    "@angular-eslint/template-parser": "~13.0.1",
    "@angular/cli": "~13.2.0",
    "@angular/compiler-cli": "~13.2.0",
    "@angular/language-service": "~13.2.0",
    "@nrwl/cli": "13.8.1",
    "@nrwl/cypress": "13.8.1",
    "@nrwl/eslint-plugin-nx": "13.8.1",
    "@nrwl/jest": "13.8.1",
    "@nrwl/linter": "13.8.1",
    "@nrwl/tao": "13.8.1",
    "@nrwl/workspace": "13.8.1",
    "@schematics/angular": "~13.2.0",
    "@types/jest": "27.0.2",
    "@types/node": "16.11.7",
    "@typescript-eslint/eslint-plugin": "~5.10.0",
    "@typescript-eslint/parser": "~5.10.0",
    "cypress": "^9.1.0",
    "eslint": "~8.7.0",
    "eslint-config-prettier": "8.1.0",
    "eslint-plugin-cypress": "^2.10.3",
    "jest": "27.2.3",
    "jest-preset-angular": "11.0.0",
    "prettier": "^2.5.1",
    "ts-jest": "27.0.5",
    "typescript": "~4.5.2"
  }
}

EDIT:

This happens when i am using nx reset and after that using nx serve again:

   Log file with the error: C:UsersHasanOneDriveDesktopMoniesta-ProjectsMoniesta-Combinatioonmoniesta-managementmoniesta-adminnode_modules.cachenxddaemon-error.log
   Please file an issue at https://github.com/nrwl/nx
   Nx Daemon is going to be disabled until you run "nx reset".

In the Daemon log it just says the same error:

 NX   spawn ENAMETOOLONG

Неделю назад я создал угловой проект с nrwl/nx, в то время я мог генерировать библиотеки и компоненты и мог начать свой проект, но сейчас я получаю следующую ошибку:

spawn ENAMETOOLONG

Эта ошибка возникает всякий раз, когда я пытаюсь запустить npm run start, который запускает nx serve прямо сейчас. ng serve тоже не работает. Я могу запустить npm install, но ничего не могу запустить мое приложение. Вот мой package.json, если вам нужна какая-либо другая информация, которую я могу предоставить:

{
  "name": "moniesta-admin",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2015 browser module main",
    "start": "nx serve",
    "build": "nx build",
    "test": "nx test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~13.2.0",
    "@angular/cdk": "^13.0.0",
    "@angular/common": "~13.2.0",
    "@angular/compiler": "~13.2.0",
    "@angular/core": "~13.2.0",
    "@angular/forms": "~13.2.0",
    "@angular/localize": "~13.2.0",
    "@angular/material": "^13.2.2",
    "@angular/platform-browser": "~13.2.0",
    "@angular/platform-browser-dynamic": "~13.2.0",
    "@angular/router": "~13.2.0",
    "@nebular/auth": "^9.0.1",
    "@nebular/eva-icons": "^9.0.1",
    "@nebular/theme": "^9.0.1",
    "@ng-bootstrap/ng-bootstrap": "^11.0.0",
    "@nrwl/angular": "13.8.1",
    "bootstrap": "^5.1.3",
    "eva-icons": "^1.1.3",
    "rxjs": "~7.4.0",
    "tslib": "^2.0.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~13.2.0",
    "@angular-eslint/eslint-plugin": "~13.0.1",
    "@angular-eslint/eslint-plugin-template": "~13.0.1",
    "@angular-eslint/template-parser": "~13.0.1",
    "@angular/cli": "~13.2.0",
    "@angular/compiler-cli": "~13.2.0",
    "@angular/language-service": "~13.2.0",
    "@nrwl/cli": "13.8.1",
    "@nrwl/cypress": "13.8.1",
    "@nrwl/eslint-plugin-nx": "13.8.1",
    "@nrwl/jest": "13.8.1",
    "@nrwl/linter": "13.8.1",
    "@nrwl/tao": "13.8.1",
    "@nrwl/workspace": "13.8.1",
    "@schematics/angular": "~13.2.0",
    "@types/jest": "27.0.2",
    "@types/node": "16.11.7",
    "@typescript-eslint/eslint-plugin": "~5.10.0",
    "@typescript-eslint/parser": "~5.10.0",
    "cypress": "^9.1.0",
    "eslint": "~8.7.0",
    "eslint-config-prettier": "8.1.0",
    "eslint-plugin-cypress": "^2.10.3",
    "jest": "27.2.3",
    "jest-preset-angular": "11.0.0",
    "prettier": "^2.5.1",
    "ts-jest": "27.0.5",
    "typescript": "~4.5.2"
  }
}

РЕДАКТИРОВАТЬ:

Это происходит, когда я использую nx reset, а после этого снова использую nx serve:

   Log file with the error: C:UsersHasanOneDriveDesktopMoniesta-ProjectsMoniesta-Combinatioonmoniesta-managementmoniesta-adminnode_modules.cachenxddaemon-error.log
   Please file an issue at https://github.com/nrwl/nx
   Nx Daemon is going to be disabled until you run "nx reset".

В логе демона такая же ошибка:

 NX   spawn ENAMETOOLONG

5 ответов

Эта ошибка обычно появляется, когда у вас слишком много незафиксированных файлов (по моему опыту, в диапазоне более 700 или около того). Передача файлов обычно решает проблему.


8

jurev
20 Май 2022 в 18:36

Я только что столкнулся с этой проблемой. Решение, которое сработало для меня, я нашел здесь

В моем случае я получал эту ошибку при запуске npm start, nx serve. После удаления папки node_modules и запуска npm install я обнаружил, что запуск npm install также вызывает эту ошибку.

У меня были незафиксированные изменения в ветке. Ошибка исчезла после фиксации работы.


1

LH7
21 Мар 2022 в 05:05

Я не знаю, почему это связано с GIT, но да, наличие слишком большого количества незафиксированных файлов является основной причиной проблемы.


1

Labidi Aymen
12 Авг 2022 в 19:10

У меня была такая же проблема, и я решил ее следующим образом:

Первое: обновление Nx до версии 13.8.5. Сделайте, как показано ниже:

  1. Выполните команду: nx migrate @nrwl/workspace@13.8.5
  2. Выполните команду: npm install
  3. Выполните команду: nx migrate —run-migrations
  4. Удалите файл «migrations.json» в корневом каталоге рабочей области nx.

Второе: глобально переустановите npm на основе nx версии 13.8.5. Сделайте, как показано ниже:

  1. Выполните команду: npm i -g nx@13.8.5


0

Kamran Taghaddos
26 Мар 2022 в 16:02

Я только что столкнулся с той же проблемой. Я удалил папку node_modules вручную, а затем переустановил все с помощью npm install. Также обнаружено, что в корневой папке есть новая папка .angular, которой раньше не было. После полного удаления этой папки я смог снова запустить сборку. Не совсем уверен, что если запустить nx build один раз (который снова заполняет эту папку), вам не следует стирать его еще раз.


2

Mátyás Jáni
21 Фев 2022 в 16:55

09.03.2020

Просмотров: 44616

На компьютере с Windows 7, 8 и 10 при запуске программы Skype, Faceit и Discord может появиться ошибка JavaScript error occurred in the main process, которая свидетельствует о повреждении системных файлов, отключении нужной службы или о необходимости применения прав Администратора. Решение данной ошибки достаточно простое. Однако для каждой программы будут отличаться некоторые рекомендации.

Читайте также: Как исправить ошибку 0xc0000906 на Windows 7 при запуске игр и приложений?

Методы решения ошибки JavaScript error occurred in the main process

Если при запуске программы Skype, Faceit и Discord на вашем ПК возникла ошибка JavaScript error occurred in the main process, то в первую очередь нужно снять задачу в Диспетчере задач. Для этого нужно нажать на Панели задач провой кнопкой мыши и выбрать «Запустить Диспетчер задач».

Далее переходим во вкладку «Процессы» и завершаем процессы, которые связаны с программой, при запуске которой вылетает ошибка.

После того, как задачи к приложениям были сняты, нужно очистить папки программ с кэшем. Для этого нужно нажать «Win+R», чтобы вызвать окно «Выполнить» и ввести %appdata%.

Находим папку программы, при запуске которой возникает ошибка JavaScript error occurred in the main process и удаляем её.

 

Теперь в окне «Выполнить» необходимо ввести %localappdata% и также найти и удалить директорию, принадлежащую сбойной программе. После этого перезагружаем систему. Программа сама создаст нужные папки.

В случае, если после удаления данных папок ошибка не исчезла, рекомендуем полностью удалить программу и установить её заново, только с применением прав Администратора. Для этого нужно нажать на ярлыке софта правой кнопкой мыши и вызвать «Свойства». Далее переходим во вкладку «Совместимость» и ставим галочку «Выполнить запуск от имени Администратора».

В случае, если такая ошибка возникала в программе Skype, то проблема может крыться в отсутствии браузера Internet Explorer, который нужен для нормальной работы некоторых функций Windows. В данном случае рекомендуем выполнить следующие действия:

  • Открываем «Проводник», нажимаем на кнопке «Удалить или изменить программу».

  • Появиться окно с установленными программами. В меню слева выбираем «Включение или отключение компонентов Windows».

  • Появиться небольшое окно. Нужно найти браузер Internet Explorer. Возле него должна стоять отметка. Смотрим также версию программы. Для нормальной работы Скайпа нужен Internet Explorer 11.

  • Если у вас версия браузера ниже, то нужно обновить операционную систему, включив ту версию браузера, которая есть. Если же вы обновили Windows, но версия браузера не изменилась, то можно перейти на официальный сайт Майкрософт и скачать Internet Explorer 11. Обращаем внимание на разрядность программы. Нужно скачать софт в соответствии с разрядностью своей Windows.
  • Устанавливаем программу, обязательно обновляем сам Скайп.

Если ошибка и после данных манипуляций не была исправлена, то пробуем перерегистрировать файл dll. Для этого советуем открыть командную строку с правами Администратора и ввести regsvr32 jscript.dll.

Перезагружаем систему, чтобы изменения вступили в силу и проверяем, исправлена ли ошибка.

Также на зарубежных форумах пользователи указывали, что ошибка A JavaScript error occurred in the main process появлялась по причине неверной работы службы Quality Windows Audio Video Experience. Исправить неполадку удалось путем изменения типа запуска службы с ручного на автоматический. Для этого нужно нажать «Win+R» и ввести «services.msc». Находим службу.

Двойным кликом открываем окно службы и меняем тип запуска.

Перезагружаем систему и проверяем, появляется ли ошибка или нет.

Если исправить ошибку A JavaScript error occurred in the main process вышеуказанными способами не удалось, рекомендуем проверить систему на вирусы и выполнить восстановление системы с помощью контрольной точки или установочного диска.

У меня Windows 10, и я работаю с node.js, и я работаю с node-jq@1.10.0 (последняя версия на данный момент)

Я хочу получить некоторую информацию из JSON с помощью jq.
Поэтому я использую функцию jq.run с параметром json в качестве параметра.
Но это выдает мне ошибку, я знаю, что мои запросы хороши, и весь мой код работает без строки, начинающейся с «пусть AllKOMoves = …».

Мой JSON хорошо отформатирован, и я пробую эту программу в JMES Path, и она работает хорошо, поэтому с JSON проблем нет. Я провел некоторые исследования, и некоторые люди сказали, что моя ОС не может поддерживать слишком длинный запрос. Я хочу уточнить, что один из моих JSON весит 6Mo.

Я провел несколько исследований в Интернете, и некоторые из них говорят о «Не указывать .catch(…)» на этом сайте: здесь, а этот говорит о слишком длинный запрос: здесь.

Вот мой код, в котором я убрал const jq = require(‘node-jq’); из асинхронной функции.

(async ()=>{
    let name = "abomasnow"; 
    const fileContent = fs.readFileSync(`./Pokemon with move CSV/Queries/nonStatusMove/${name}nonStatusMove.csv`);
    let pokemonSubject = JSON.parse(await jq.run(`. | map(select(.name == "${name}"))[0]`, './nameBSTypeAbilityWeight.json'));
    var allMoves = moveToJSON(fileContent);
    let AllKOMoves = await jq.run(`. | map(select(.Moves | map(select(.Max == 100)) | length > 1)) | map({Nature: .Nature, EV: .EV, Moves: [.Moves | map(select(.Max == 100))[] | .Move], MovesCount: .Moves | length})`,getAllInflictedDamage(pokemonSubject, allMoves, pokemonJSON[0]),{ input: 'json' })
    console.info(AllKOMoves);
    })();

Вот пример JSON, сгенерированного этой частью кода getAllInflictedDamage(pokemonSubject, allMoves, pokemonJSON[0]):

[  
   {  
      "Opponent":"abomasnow",
      "Move":"wood-hammer",
      "Min":16.15,
      "Max":19.25,
      "Crit":28.88
   },
   {  
      "Opponent":"abomasnow",
      "Move":"round",
      "Min":15.84,
      "Max":18.94,
      "Crit":28.26
   }
]

Вот пример JSON, содержащегося в переменной allMoves:

[  
   {  
      "name":"bulldoze",
      "accuracy":"100",
      "category":"physical",
      "power":"60",
      "priority":"0",
      "target":"all-other-pokemon",
      "type":"ground"
   },
   {  
      "name":"frost-breath",
      "accuracy":"90",
      "category":"special",
      "power":"60",
      "priority":"0",
      "target":"selected-pokemon",
      "type":"ice"
   }
]

Я ожидал содержимого моего JSON, но он выдает это сообщение об ошибке:

(node:21792) UnhandledPromiseRejectionWarning: Error: spawn ENAMETOOLONG
    at ChildProcess.spawn (internal/child_process.js:366:11)
    at Object.spawn (child_process.js:538:9)
    at C:Usersadelanode_modulesnode-jqlibexec.js:24:43
    at new Promise (<anonymous>)
    at exec (C:Usersadelanode_modulesnode-jqlibexec.js:20:10)
    at C:Usersadelanode_modulesnode-jqlibjq.js:24:24
    at new Promise (<anonymous>)
    at Object.run (C:Usersadelanode_modulesnode-jqlibjq.js:19:10)
    at C:Usersadelanode_codecalcDamage1forAll.js:757:28
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:21792) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:21792) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Обычно мой код должен получать такую ​​информацию:

[  
   {  
      "Nature":"brave",
      "EV":[  
         4,
         0,
         0,
         0,
         252,
         252
      ],
      "Moves":[  
         "focus-punch",
         "natural-gift-fire90",
         "natural-gift-fire100",
         "natural-gift-fire80"
      ],
      "MovesCount":4
   },
   {  
      "Nature":"brave",
      "EV":[  
         0,
         252,
         252,
         4,
         0,
         0
      ],
      "Moves":[  
         "natural-gift-fire90",
         "natural-gift-fire100",
         "natural-gift-fire80"
      ],
      "MovesCount":3
   }
]

Обновлено: Если я сделаю это только так:

let AllKOMoves = await jq.run(`.`,getAllInflictedDamage(pokemonSubject, allMoves, pokemonJSON[0]),{ input: 'json' })

Это также дает мне ту же ошибку!

РЕДАКТИРОВАТЬ2: Если я сделаю это:

let AllKOMoves = await jq.run(`.`,{"foo":"bar"},{ input: 'json' })

Это работает отлично! С некоторыми исследованиями я думаю, что это просто размер json, потому что мой размер json ~ 12Mo, я пытаюсь с json 300 Ko, он тоже не работает, поэтому я думаю, что только мой json слишком велик.

Теперь мой вопрос заключается в том, чтобы узнать, существует ли другое решение, которое создает временные файлы, подобные предложенным в первом ответе…

I’m on windows 10, and I work with node.js, and I work with node-jq@1.10.0 (the lastest version at this moment)

I want to retrieve some information from a JSON with jq. So I use jq.run function with ‘json’ as option parameter. But it throw me an error, I know my queries are good, and all my code work without the line which start with «let AllKOMoves = …«.

My JSON are well formatted and I try this program in JMES Path and it’s work well, so there no problem with JSON. I did some researches and some people said that my OS cannot support a too long request. I want to precise that on of my JSON weighs 6Mo.

I did some researches on internet and some of them talk about «Not specifying a .catch(…)» on this website: here and this one talk about the too long query: here

Here’s my code I put the const jq = require('node-jq'); out of the async function.

(async ()=>{
    let name = "abomasnow"; 
    const fileContent = fs.readFileSync(`./Pokemon with move CSV/Queries/nonStatusMove/${name}nonStatusMove.csv`);
    let pokemonSubject = JSON.parse(await jq.run(`. | map(select(.name == "${name}"))[0]`, './nameBSTypeAbilityWeight.json'));
    var allMoves = moveToJSON(fileContent);
    let AllKOMoves = await jq.run(`. | map(select(.Moves | map(select(.Max == 100)) | length > 1)) | map({Nature: .Nature, EV: .EV, Moves: [.Moves | map(select(.Max == 100))[] | .Move], MovesCount: .Moves | length})`,getAllInflictedDamage(pokemonSubject, allMoves, pokemonJSON[0]),{ input: 'json' })
    console.log(AllKOMoves);
    })();

Here’s a sample of the JSON generate by this portion of code getAllInflictedDamage(pokemonSubject, allMoves, pokemonJSON[0]):

[  
   {  
      "Opponent":"abomasnow",
      "Move":"wood-hammer",
      "Min":16.15,
      "Max":19.25,
      "Crit":28.88
   },
   {  
      "Opponent":"abomasnow",
      "Move":"round",
      "Min":15.84,
      "Max":18.94,
      "Crit":28.26
   }
]

Here’s is a sample of the JSON contains in the variable allMoves:

[  
   {  
      "name":"bulldoze",
      "accuracy":"100",
      "category":"physical",
      "power":"60",
      "priority":"0",
      "target":"all-other-pokemon",
      "type":"ground"
   },
   {  
      "name":"frost-breath",
      "accuracy":"90",
      "category":"special",
      "power":"60",
      "priority":"0",
      "target":"selected-pokemon",
      "type":"ice"
   }
]

I expected the content of my JSON, but it throw this error message:

(node:21792) UnhandledPromiseRejectionWarning: Error: spawn ENAMETOOLONG
    at ChildProcess.spawn (internal/child_process.js:366:11)
    at Object.spawn (child_process.js:538:9)
    at C:Usersadelanode_modulesnode-jqlibexec.js:24:43
    at new Promise (<anonymous>)
    at exec (C:Usersadelanode_modulesnode-jqlibexec.js:20:10)
    at C:Usersadelanode_modulesnode-jqlibjq.js:24:24
    at new Promise (<anonymous>)
    at Object.run (C:Usersadelanode_modulesnode-jqlibjq.js:19:10)
    at C:Usersadelanode_codecalcDamage1forAll.js:757:28
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:21792) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:21792) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Normally my code should retrieve information like this:

[  
   {  
      "Nature":"brave",
      "EV":[  
         4,
         0,
         0,
         0,
         252,
         252
      ],
      "Moves":[  
         "focus-punch",
         "natural-gift-fire90",
         "natural-gift-fire100",
         "natural-gift-fire80"
      ],
      "MovesCount":4
   },
   {  
      "Nature":"brave",
      "EV":[  
         0,
         252,
         252,
         4,
         0,
         0
      ],
      "Moves":[  
         "natural-gift-fire90",
         "natural-gift-fire100",
         "natural-gift-fire80"
      ],
      "MovesCount":3
   }
]

EDIT: If I only do this:

let AllKOMoves = await jq.run(`.`,getAllInflictedDamage(pokemonSubject, allMoves, pokemonJSON[0]),{ input: 'json' })

it also give me the same error !

EDIT2: If I do this:

let AllKOMoves = await jq.run(`.`,{"foo":"bar"},{ input: 'json' })

it work perfectly ! With some researches I think it’s just about the size of json because my json size ~12Mo, I try with a 300 Ko json it doesn’t work too so I think just my json are too big.

My question now is to know if it exists other solution that create a temporary files like it proposed in the first answer…

8 hữu ích 5 bình luận 22k xem chia sẻ

Recommend Projects

  • React photo

    React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo

    Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo

    Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo

    TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo

    Django

    The Web framework for perfectionists with deadlines.

  • Laravel photo

    Laravel

    A PHP framework for web artisans

  • D3 photo

    D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Visualization

    Some thing interesting about visualization, use data art

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo

    Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo

    Microsoft

    Open source projects and samples from Microsoft.

  • Google photo

    Google

    Google ❤️ Open Source for everyone.

  • Alibaba photo

    Alibaba

    Alibaba Open Source for everyone

  • D3 photo

    D3

    Data-Driven Documents codes.

  • Tencent photo

    Tencent

    China tencent open source team.

При запуске программ как Discord, Skype или Faceit может появится сообщение об ошибке «A JavaScript error occurred in the main process» в Windows 10/8.1/7. В большинстве случаях ошибка может возникать из-за повреждение самой программы, отключена служба Audio Video Experience или когда программа запускается с правами администратора.

A JavaScript error occurred in the main process

Удаление параметров для Discord, Skype или Faceit

Discord или Faceit

Шаг 1. Откройте диспетчер задач нажав сочетание кнопок Ctrl+Shift+Esc. Найдите в писке программу, которая выдает ошибку «A JavaScript error occurred in the main process«, выделите её и ниже нажмите на «Снять задачу«, чтобы завершить процесс данной программы.

диспетчер задач diskort

Шаг 2. Нажмите сочетание кнопок Win+R и введите %appdata%, чтобы быстро открыть расположение временных файлов программ. Найдите папку с именем программы, в данном случае diskort, и удалите её.

удалить папку в Roaming

Шаг 3. Нажмите снова Win+R и введите %localappdata%, найдите папку с именем программы, которая выдает ошибку JavaScript и удалите её. Обратите внимание, что папка Diskort называется в точности, в отличие от Faceit, где есть на конце app.

папки в Local

Skype

В программе скайп тоже может возникнуть ошибка «A JavaScript error occurred in the main process«. Это связано с тем, что нужен Internet Explorer 11, а в Windows 7 его нет, там последняя версия 8. Некоторые пользователи пытаются удалить этот браузер даже в Windows 10 не понимая того, что это не совсем браузер, и он отвечает за работу некоторых системных функций. Вы должны выполнить следующие действия:

channel

  1. Скачать последнюю версию Skype с официального сайта.
  2. Установить Internet Explorer 11 с официального сайта.
  3. Если вы обновили Internet Explorer с 8 до последней версии, то его нужно сбросить. Нажмите сочетание кнопок Win+R и введите inetcpl.cpl, чтобы быстро открыть свойства интернета. Перейдите во вкладку «Дополнительно» и «Сброс…«. (рис. 1).
  4. Перейдите во вкладку «Безопасность» и нажмите «Другой…«. В списке найдите «Активные сценарии» и Включить. (рис. 2).

Сброс параметров интернета

включить сценарии

Служба Quality Windows Audio Video Experience

Изменение типа запуска службы качества Quality Windows Audio Video Experience с «Вручную» на «Автоматически» позволяет устранить ошибку JavaScript для многих пользователей.

Нажмите Win+R и введите services.msc, чтобы быстро открыть службы. В списке служб найдите Quality Windows Audio Video Experience и щелкните по ней два раза, чтобы открыть свойства. Нажмите «Остановить«, если она работает, далее выберите тип запуска «Автоматически» и «Запустить«.

Quality Windows Audio Video Experience тип запуска авто

Запустите программу без прав администратора

Найдите исполняемый файл программы, которая выдает ошибку «A JavaScript error occurred in the main process» и нажмите по ней правой кнопкой мыши и выберите «Свойства». Перейдите во вкладку «Совместимость» и уберите галочку «Запускать эту программу рот имени админа«.

запустить Diskort без прав админа

Перерегистрируйте DLL файл JavaScript

Регистрация DLL файла JavaScript с помощью встроенного Regsvr.exe может помочь. Откройте командную строку от имени администратора и введите:

  • regsvr32 jscript.dll

регистрация DLL JavaScript


Смотрите еще:

  • Ошибка 0xc0000135 при запуске игры или программы 
  • Исправить ошибку 0xc0000906 при запуске приложения 
  • Ошибка 0xc0000022 при запуске Игр и Программ
  • Ошибка Windows Script Host при запуске Windows 10
  • Ошибка при запуске приложения 0xc0000142 в Windows 10

[ Telegram | Поддержать ]

Понравилась статья? Поделить с друзьями:
  • Faceit anticheat ошибка windows update как исправить windows 10
  • Faceit anticheat error your system hasn t been patched against critical
  • Faceit anticheat error windows update windows 10
  • Faceit ac unknown error 0x000000d8
  • Faceit ac error your system has been patched against critical windows security vulnerabilities