Open tomchen opened 3 years ago
I don't have the environment to reproduce the problem. I am also unsure if I can fix it, because the error looks totally unrelated to OpenCC.
Does npm work?
[4/4] 🔨 Building fresh packages... [1/8] ⠄ fsevents [2/8] ⠄ opencc [-/8] ⠄ waiting... [-/8] ⡀ waiting... error /Users/xxx/Desktop/ddd/node_modules/opencc: Command failed. Exit code: 1 Command: node-pre-gyp install --fallback-to-build || node-pre-gyp rebuild Arguments: Directory: /Users/xxx/Desktop/ddd/node_modules/opencc
node: v12.12.0 yarn:v1.22.10
macOS 10.15.7 (catalina)
Same here.
[4/4] Building fresh packages... [-/14] ⡀ waiting... [12/14] ⡀ opencc [-/14] ⡀ waiting... [11/14] ⡀ ejs error /home/UserName/ProjectName//node_modules/opencc: Command failed. Exit code: 1 Command: node-pre-gyp install --fallback-to-build || node-pre-gyp rebuild
node -v
v16.12.0
yarn -v
1.22.11
Ubuntu 20.04 LTS
Windows users can't
yarn add
the Node version of opencc, if an older version of node-gyp (for example, v3.8.0) is among the existent dependencies (or dependencies of dependencies).My environment:
I've also tested other environments:
with GitHub Actions CI here: https://github.com/tomchen/opencc-nodegyp-test/actions/runs/451084285
No problem in Ubuntu and MacOS, or in Windows with npm (but got some warnings).
And the latest version v7.1.0 of node-gyp has no problem (with yarn) either.
To reproduce:
Create an empty folder, inside the folder, create a package.json:
Then run
All good. Then:
No luck, it fails, on my machine, it shows:
I don't know if you are gonna "fix" it or not, you see it's a Win+yarn-only issue and updating to the latest version of node-gyp can solve the problem. But On the other hand many packages use older versions of node-gyp, for example, the popular node-sass version 4.x.x (the latest 5.0.0 released in Oct 2020 has no problem since it switched to the latest version of node-gyp), which many projects and packages are still using today.