# 問題描述
要把 theme 轉為 shokaX 時,執行 SXC install shokaX
出現錯誤訊息
error /workspaces/page/node_modules/deasync: Command failed. | |
Exit code: 1 | |
Command: node ./build.js | |
Arguments: | |
Directory: /workspaces/page/node_modules/deasync | |
Output: | |
node:events:495 | |
throw er; // Unhandled 'error' event | |
^ | |
Error: spawn node-gyp ENOENT | |
at ChildProcess._handle.onexit (node:internal/child_process:284:19) | |
at onErrorNT (node:internal/child_process:477:16) | |
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) | |
Emitted 'error' event on ChildProcess instance at: | |
at ChildProcess._handle.onexit (node:internal/child_process:290:12) | |
at onErrorNT (node:internal/child_process:477:16) | |
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { | |
errno: -2, | |
code: 'ENOENT', | |
syscall: 'spawn node-gyp', | |
path: 'node-gyp', | |
spawnargs: [ 'rebuild' ] | |
} | |
Node.js v18.18.2 | |
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command. |
# 環境
- Docker image: node:18-slim
# 修正方法
安裝下面套件,不確定 make
, g++
需不需要,因為之前遇過類似的問題都裝這三個,所以直接複製過來用。如果沒有安裝的話,在安裝 node-gyp
會出現其他錯誤。
apt-get install -y python3 make g++ |
安裝 node-gyp
pnpm add -g node-gyp |