vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.78k stars 390 forks source link

I get an opencc error when installing @volar/vue-language-server@1.1.0 with yarn #2388

Closed yaegassy closed 1 year ago

yaegassy commented 1 year ago

Description

I use yarn as my package manager.

I get an error when installing @volar/vue-language-server's version 1.1.0 with yarn (@mapbox/node-pre-gyp issue?)

This may be a node-gyp related issue. The version of Python installed in your environment may also affect

I have installed Python3 only. In environments where Python2 is also installed, this problem does not seem to occur.

Repro

Shell

mkdir -p /tmp/check
cd /tmp/check
yarn init -y
yarn add @volar/vue-language-server@1.1.0

Log

Log ``` check$ yarn init -y yarn init v1.22.19 warning The yes flag has been set. This will automatically answer yes to all questions, which may have security implications. success Saved package.json ✨ Done in 0.01s. check$ yarn add @volar/vue-language-server@1.1.0 yarn add v1.22.19 info No lockfile found. [1/4] 🔍 Resolving packages... warning @volar/vue-language-server > @volar/vue-language-core > @vue/compiler-sfc > magic-string > sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead warning @volar/vue-language-server > @volar/vue-language-service > opencc > node-pre-gyp@0.14.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future [2/4] 🚚 Fetching packages... [3/4] 🔗 Linking dependencies... warning "@volar/vue-language-server > vue-component-meta@1.1.0" has unmet peer dependency "typescript@*". [4/4] 🔨 Building fresh packages... warning Error running install script for optional dependency: "/private/tmp/check/node_modules/opencc: Command failed. Exit code: 1 Command: node-pre-gyp install --fallback-to-build || node-pre-gyp rebuild Arguments: Directory: /private/tmp/check/node_modules/opencc Output: node-pre-gyp info it worked if it ends with ok node-pre-gyp info using node-pre-gyp@0.14.0 node-pre-gyp info using node@18.14.0 | darwin | arm64 node-pre-gyp WARN Using needle for node-pre-gyp https download node-pre-gyp info check checked for \"/private/tmp/check/node_modules/opencc/build/Release/opencc.node\" (not found) node-pre-gyp http GET https://github.com/BYVoid/OpenCC/releases/download/1.1.3/opencc-v1.1.3-node-v108-darwin-arm64.tar.gz node-pre-gyp http 404 https://github.com/BYVoid/OpenCC/releases/download/1.1.3/opencc-v1.1.3-node-v108-darwin-arm64.tar.gz node-pre-gyp WARN Tried to download(404): https://github.com/BYVoid/OpenCC/releases/download/1.1.3/opencc-v1.1.3-node-v108-darwin-arm64.tar.gz node-pre-gyp WARN Pre-built binaries not found for opencc@1.1.3 and node@18.14.0 (node-v108 ABI, unknown) (falling back to source compile with node-gyp) node-pre-gyp http 404 status code downloading tarball https://github.com/BYVoid/OpenCC/releases/download/1.1.3/opencc-v1.1.3-node-v108-darwin-arm64.tar.gz gyp info it worked if it ends with ok gyp info using node-gyp@9.3.1 gyp info using node@18.14.0 | darwin | arm64 gyp info ok gyp info it worked if it ends with ok gyp info using node-gyp@9.3.1 gyp info using node@18.14.0 | darwin | arm64 gyp info find Python using Python version 3.11.1 found at \"/Library/Frameworks/Python.framework/Versions/3.11/bin/python3\" gyp info spawn /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 gyp info spawn args [ gyp info spawn args '/Users/yaegassy/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'make', gyp info spawn args '-I', gyp info spawn args '/private/tmp/check/node_modules/opencc/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/Users/yaegassy/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/Users/yaegassy/Library/Caches/node-gyp/18.14.0/include/node/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/Users/yaegassy/Library/Caches/node-gyp/18.14.0', gyp info spawn args '-Dnode_gyp_dir=/Users/yaegassy/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp', gyp info spawn args '-Dnode_lib_file=/Users/yaegassy/Library/Caches/node-gyp/18.14.0/<(target_arch)/node.lib', gyp info spawn args '-Dmodule_root_dir=/private/tmp/check/node_modules/opencc', gyp info spawn args '-Dnode_engine=v8', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'build', gyp info spawn args '-Goutput_dir=.' gyp info spawn args ] gyp info ok gyp info it worked if it ends with ok gyp info using node-gyp@9.3.1 gyp info using node@18.14.0 | darwin | arm64 gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] COPY Release/hk2s.json COPY Release/hk2t.json COPY Release/jp2t.json COPY Release/s2hk.json COPY Release/s2t.json COPY Release/s2tw.json COPY Release/s2twp.json COPY Release/t2hk.json COPY Release/t2jp.json COPY Release/t2s.json COPY Release/t2tw.json COPY Release/tw2s.json COPY Release/tw2sp.json COPY Release/tw2t.json TOUCH Release/obj.target/configs.stamp CXX(target) Release/obj.target/opencc/node/marisa.o CXX(target) Release/obj.target/opencc/node/opencc.o SOLINK_MODULE(target) Release/opencc.node ACTION binding_gyp_dicts_target_STCharacters Release/STCharacters.ocd2 ACTION binding_gyp_dicts_target_STPhrases Release/STPhrases.ocd2 ACTION binding_gyp_dicts_target_TSCharacters Release/TSCharacters.ocd2 ACTION binding_gyp_dicts_target_TSPhrases Release/TSPhrases.ocd2 ACTION binding_gyp_dicts_target_TWVariants Release/TWVariants.ocd2 ACTION binding_gyp_dicts_target_TWVariantsRevPhrases Release/TWVariantsRevPhrases.ocd2 ACTION binding_gyp_dicts_target_JPVariants Release/JPVariants.ocd2 ACTION binding_gyp_dicts_target_TWPhrases_txt Release/TWPhrases.txt /bin/sh: python: command not found make: *** [Release/TWPhrases.txt] Error 127 gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/Users/yaegassy/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23) gyp ERR! stack at ChildProcess.emit (node:events:513:28) gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12) gyp ERR! System Darwin 22.3.0 gyp ERR! command \"/Users/yaegassy/.nvm/versions/node/v18.14.0/bin/node\" \"/Users/yaegassy/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"build\" \"--fallback-to-build\" \"--module=/private/tmp/check/node_modules/opencc/build/Release/opencc.node\" \"--module_name=opencc\" \"--module_path=/private/tmp/check/node_modules/opencc/build/Release\" \"--napi_version=8\" \"--node_abi_napi=napi\" \"--napi_build_version=0\" \"--node_napi_label=node-v108\" gyp ERR! cwd /private/tmp/check/node_modules/opencc gyp ERR! node -v v18.14.0 gyp ERR! node-gyp -v v9.3.1 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/Users/yaegassy/.nvm/versions/node/v18.14.0/bin/node /Users/yaegassy/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/private/tmp/check/node_modules/opencc/build/Release/opencc.node --module_name=opencc --module_path=/private/tmp/check/node_modules/opencc/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1) node-pre-gyp ERR! stack at ChildProcess. (/private/tmp/check/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (node:events:513:28) node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1091:16) node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:302:5) node-pre-gyp ERR! System Darwin 22.3.0 node-pre-gyp ERR! command \"/Users/yaegassy/.nvm/versions/node/v18.14.0/bin/node\" \"/private/tmp/check/node_modules/opencc/node_modules/.bin/node-pre-gyp\" \"install\" \"--fallback-to-build\" node-pre-gyp ERR! cwd /private/tmp/check/node_modules/opencc node-pre-gyp ERR! node -v v18.14.0 node-pre-gyp ERR! node-pre-gyp -v v0.14.0 node-pre-gyp ERR! not ok Failed to execute '/Users/yaegassy/.nvm/versions/node/v18.14.0/bin/node /Users/yaegassy/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/private/tmp/check/node_modules/opencc/build/Release/opencc.node --module_name=opencc --module_path=/private/tmp/check/node_modules/opencc/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1) node-pre-gyp info it worked if it ends with ok node-pre-gyp info using node-pre-gyp@0.14.0 node-pre-gyp info using node@18.14.0 | darwin | arm64 [opencc] Removing \"/private/tmp/check/node_modules/opencc/build/Release\" gyp info it worked if it ends with ok gyp info using node-gyp@9.3.1 gyp info using node@18.14.0 | darwin | arm64 gyp info ok gyp info it worked if it ends with ok gyp info using node-gyp@9.3.1 gyp info using node@18.14.0 | darwin | arm64 gyp info find Python using Python version 3.11.1 found at \"/Library/Frameworks/Python.framework/Versions/3.11/bin/python3\" gyp info spawn /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 gyp info spawn args [ gyp info spawn args '/Users/yaegassy/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'make', gyp info spawn args '-I', gyp info spawn args '/private/tmp/check/node_modules/opencc/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/Users/yaegassy/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/Users/yaegassy/Library/Caches/node-gyp/18.14.0/include/node/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/Users/yaegassy/Library/Caches/node-gyp/18.14.0', gyp info spawn args '-Dnode_gyp_dir=/Users/yaegassy/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp', gyp info spawn args '-Dnode_lib_file=/Users/yaegassy/Library/Caches/node-gyp/18.14.0/<(target_arch)/node.lib', gyp info spawn args '-Dmodule_root_dir=/private/tmp/check/node_modules/opencc', gyp info spawn args '-Dnode_engine=v8', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'build', gyp info spawn args '-Goutput_dir=.' gyp info spawn args ] gyp info ok gyp info it worked if it ends with ok gyp info using node-gyp@9.3.1 gyp info using node@18.14.0 | darwin | arm64 gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] COPY Release/hk2s.json COPY Release/hk2t.json COPY Release/jp2t.json COPY Release/s2hk.json COPY Release/s2t.json COPY Release/s2tw.json COPY Release/s2twp.json COPY Release/t2hk.json COPY Release/t2jp.json COPY Release/t2s.json COPY Release/t2tw.json COPY Release/tw2s.json COPY Release/tw2sp.json COPY Release/tw2t.json TOUCH Release/obj.target/configs.stamp CXX(target) Release/obj.target/opencc/node/marisa.o CXX(target) Release/obj.target/opencc/node/opencc.o SOLINK_MODULE(target) Release/opencc.node ACTION binding_gyp_dicts_target_STCharacters Release/STCharacters.ocd2 ACTION binding_gyp_dicts_target_STPhrases Release/STPhrases.ocd2 ACTION binding_gyp_dicts_target_TSCharacters Release/TSCharacters.ocd2 ACTION binding_gyp_dicts_target_TSPhrases Release/TSPhrases.ocd2 ACTION binding_gyp_dicts_target_TWVariants Release/TWVariants.ocd2 ACTION binding_gyp_dicts_target_TWVariantsRevPhrases Release/TWVariantsRevPhrases.ocd2 ACTION binding_gyp_dicts_target_JPVariants Release/JPVariants.ocd2 ACTION binding_gyp_dicts_target_TWPhrases_txt Release/TWPhrases.txt /bin/sh: python: command not found make: *** [Release/TWPhrases.txt] Error 127 gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/Users/yaegassy/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23) gyp ERR! stack at ChildProcess.emit (node:events:513:28) gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12) gyp ERR! System Darwin 22.3.0 gyp ERR! command \"/Users/yaegassy/.nvm/versions/node/v18.14.0/bin/node\" \"/Users/yaegassy/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"build\" \"--module=/private/tmp/check/node_modules/opencc/build/Release/opencc.node\" \"--module_name=opencc\" \"--module_path=/private/tmp/check/node_modules/opencc/build/Release\" \"--napi_version=8\" \"--node_abi_napi=napi\" \"--napi_build_version=0\" \"--node_napi_label=node-v108\" gyp ERR! cwd /private/tmp/check/node_modules/opencc gyp ERR! node -v v18.14.0 gyp ERR! node-gyp -v v9.3.1 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/Users/yaegassy/.nvm/versions/node/v18.14.0/bin/node /Users/yaegassy/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --module=/private/tmp/check/node_modules/opencc/build/Release/opencc.node --module_name=opencc --module_path=/private/tmp/check/node_modules/opencc/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1) node-pre-gyp ERR! stack at ChildProcess. (/private/tmp/check/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (node:events:513:28) node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1091:16) node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:302:5) node-pre-gyp ERR! System Darwin 22.3.0 node-pre-gyp ERR! command \"/Users/yaegassy/.nvm/versions/node/v18.14.0/bin/node\" \"/private/tmp/check/node_modules/opencc/node_modules/.bin/node-pre-gyp\" \"rebuild\" node-pre-gyp ERR! cwd /private/tmp/check/node_modules/opencc node-pre-gyp ERR! node -v v18.14.0 node-pre-gyp ERR! node-pre-gyp -v v0.14.0 node-pre-gyp ERR! not ok Failed to execute '/Users/yaegassy/.nvm/versions/node/v18.14.0/bin/node /Users/yaegassy/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --module=/private/tmp/check/node_modules/opencc/build/Release/opencc.node --module_name=opencc --module_path=/private/tmp/check/node_modules/opencc/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)" info This module is OPTIONAL, you can safely ignore this error success Saved lockfile. success Saved 60 new dependencies. info Direct dependencies └─ @volar/vue-language-server@1.1.0 info All dependencies ├─ @emmetio/abbreviation@2.2.3 ├─ @emmetio/css-abbreviation@2.1.4 ├─ @johnsoncodehk/pug-beautify@0.2.2 ├─ @volar-plugins/css@2.0.0-alpha.4 ├─ @volar-plugins/emmet@2.0.0-alpha.4 ├─ @volar-plugins/json@2.0.0-alpha.4 ├─ @volar-plugins/pug-beautify@2.0.0-alpha.4 ├─ @volar-plugins/pug@2.0.0-alpha.4 ├─ @volar-plugins/typescript-twoslash-queries@2.0.0-alpha.4 ├─ @volar-plugins/typescript@2.0.0-alpha.4 ├─ @volar/language-server@1.2.0-alpha.11 ├─ @volar/typescript-faster@1.2.0-alpha.11 ├─ @volar/vue-language-server@1.1.0 ├─ @volar/vue-language-service@1.1.0 ├─ @vscode/emmet-helper@2.8.6 ├─ @vue/compiler-sfc@3.2.47 ├─ @vue/compiler-ssr@3.2.47 ├─ @vue/reactivity-transform@3.2.47 ├─ acorn@7.4.1 ├─ asynckit@0.4.0 ├─ axios@1.3.3 ├─ balanced-match@1.0.2 ├─ call-bind@1.0.2 ├─ character-parser@2.2.0 ├─ combined-stream@1.0.8 ├─ de-indent@1.0.2 ├─ delayed-stream@1.0.0 ├─ emmet@2.3.6 ├─ follow-redirects@1.15.2 ├─ form-data@4.0.0 ├─ get-intrinsic@1.2.0 ├─ has-symbols@1.0.3 ├─ has-tostringtag@1.0.0 ├─ has@1.0.3 ├─ he@1.2.0 ├─ is-expression@4.0.0 ├─ is-regex@1.1.4 ├─ jsonc-parser@3.2.0 ├─ lru-cache@6.0.0 ├─ mime-db@1.52.0 ├─ mime-types@2.1.35 ├─ nanoid@3.3.4 ├─ object-assign@4.1.1 ├─ picocolors@1.0.0 ├─ postcss@8.4.21 ├─ proxy-from-env@1.1.0 ├─ pug-lexer@5.0.1 ├─ pug-parser@6.0.0 ├─ request-light@0.7.0 ├─ source-map-js@1.0.2 ├─ sourcemap-codec@1.4.8 ├─ token-stream@1.0.0 ├─ vscode-css-languageservice@6.2.3 ├─ vscode-jsonrpc@8.1.0 ├─ vscode-languageserver-textdocument@1.0.8 ├─ vscode-languageserver-types@3.17.3 ├─ vscode-languageserver@8.1.0 ├─ vscode-nls@5.2.0 ├─ vue-component-meta@1.1.0 └─ vue-template-compiler@2.7.14 ✨ Done in 17.06s. check$ ```
johnsoncodehk commented 1 year ago

Thanks to let me know, I will extract this dependency.

johnsoncodehk commented 1 year ago

Btw I suggest you wait for v1.1.2 for coc-volar, it will take care of all the regressions, I think we will have it before next monday.

yaegassy commented 1 year ago

Thanks!!!