EvgeniyPeshkov / syntax-highlighter

Syntax Highlighter extension for Visual Studio Code (VSCode). Based on Tree-sitter.
https://marketplace.visualstudio.com/items?itemName=evgeniypeshkov.syntax-highlighter
MIT License
208 stars 44 forks source link

Failed to build wasm for c when running `npm i` #65

Closed Symbolk closed 2 years ago

Symbolk commented 2 years ago

Hi, I am trying to install the dependencies with npm i, but it reports the following error:

> syntax-highlighter@0.5.1 postinstall
> node ./scripts/build.js

Compiling c parser
Compiling cpp parser
Compiling d parser
Compiling go parser
Compiling javascript parser
Compiling lua parser
Compiling ocaml parser
Compiling php parser
Compiling python parser
Compiling ruby parser
Compiling rust parser
Compiling shellscript parser
Compiling typescript parser
Compiling typescriptreact parser
Failed to build wasm for c: Command failed: node_modules/.bin/tree-sitter build-wasm node_modules/tree-sitter-c
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  path: '/Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  spawnargs: [ 'build-wasm', 'node_modules/tree-sitter-c' ]
}

Failed to build wasm for go: Command failed: node_modules/.bin/tree-sitter build-wasm node_modules/tree-sitter-go
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  path: '/Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  spawnargs: [ 'build-wasm', 'node_modules/tree-sitter-go' ]
}

Failed to build wasm for javascript: Command failed: node_modules/.bin/tree-sitter build-wasm node_modules/tree-sitter-javascript
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  path: '/Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  spawnargs: [ 'build-wasm', 'node_modules/tree-sitter-javascript' ]
}

Failed to build wasm for d: Command failed: node_modules/.bin/tree-sitter build-wasm node_modules/tree-sitter-d
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  path: '/Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  spawnargs: [ 'build-wasm', 'node_modules/tree-sitter-d' ]
}

Failed to build wasm for cpp: Command failed: node_modules/.bin/tree-sitter build-wasm node_modules/tree-sitter-cpp
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  path: '/Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  spawnargs: [ 'build-wasm', 'node_modules/tree-sitter-cpp' ]
}

Failed to build wasm for lua: Command failed: node_modules/.bin/tree-sitter build-wasm node_modules/tree-sitter-lua
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  path: '/Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  spawnargs: [ 'build-wasm', 'node_modules/tree-sitter-lua' ]
}

Failed to build wasm for ocaml: Command failed: node_modules/.bin/tree-sitter build-wasm node_modules/tree-sitter-ocaml/ocaml
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  path: '/Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  spawnargs: [ 'build-wasm', 'node_modules/tree-sitter-ocaml/ocaml' ]
}

Failed to build wasm for ruby: Command failed: node_modules/.bin/tree-sitter build-wasm node_modules/tree-sitter-ruby
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  path: '/Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  spawnargs: [ 'build-wasm', 'node_modules/tree-sitter-ruby' ]
}

Failed to build wasm for php: Command failed: node_modules/.bin/tree-sitter build-wasm node_modules/tree-sitter-php
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  path: '/Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  spawnargs: [ 'build-wasm', 'node_modules/tree-sitter-php' ]
}

Failed to build wasm for rust: Command failed: node_modules/.bin/tree-sitter build-wasm node_modules/tree-sitter-rust
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  path: '/Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  spawnargs: [ 'build-wasm', 'node_modules/tree-sitter-rust' ]
}

Failed to build wasm for shellscript: Command failed: node_modules/.bin/tree-sitter build-wasm node_modules/tree-sitter-bash
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  path: '/Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  spawnargs: [ 'build-wasm', 'node_modules/tree-sitter-bash' ]
}

Failed to build wasm for python: Command failed: node_modules/.bin/tree-sitter build-wasm node_modules/tree-sitter-python
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  path: '/Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  spawnargs: [ 'build-wasm', 'node_modules/tree-sitter-python' ]
}

Failed to build wasm for typescript: Command failed: node_modules/.bin/tree-sitter build-wasm node_modules/tree-sitter-typescript/typescript
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  path: '/Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  spawnargs: [ 'build-wasm', 'node_modules/tree-sitter-typescript/typescript' ]
}

Failed to build wasm for typescriptreact: Command failed: node_modules/.bin/tree-sitter build-wasm node_modules/tree-sitter-typescript/tsx
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  path: '/Users/symbolk/coding/vscode/syntax-highlighter/node_modules/tree-sitter-cli/tree-sitter',
  spawnargs: [ 'build-wasm', 'node_modules/tree-sitter-typescript/tsx' ]
}
Symbolk commented 2 years ago

This is a network issue, and first I need to install emsdk.