Skip to content
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

electron 桌面应用中尝试引入 #204

Closed
MrHao123 opened this issue Apr 2, 2022 · 3 comments
Closed

electron 桌面应用中尝试引入 #204

MrHao123 opened this issue Apr 2, 2022 · 3 comments

Comments

@MrHao123
Copy link

MrHao123 commented Apr 2, 2022

运行:npm i [email protected] 
引入:const { FFScene, FFText, FFVideo, FFAlbum, FFImage, FFCreator } = require("ffcreator");
node版本:14.16.1  。我有使用nvm切换其他14以上的版本,会出现不同的错误。请指出

TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type function at promisify (internal/util.js:206:11) at Object.<anonymous> (D:\Application\exeapp\electron-vue-exe\node_modules\mtempy\index.js:12:18) at Object.<anonymous> (D:\Application\exeapp\electron-vue-exe\node_modules\mtempy\index.js:78:3) at Module._compile (module.js:642:30) at Object.Module._extensions..js (module.js:653:10) at Module.load (module.js:561:32) at tryModuleLoad (module.js:504:12) at Function.Module._load (module.js:496:3) at Module.require (module.js:586:17) at require (internal/module.js:11:18)

@drawcall
Copy link
Member

It seems that the node version of your electron is too low, please console.log(process.versions); not the external node version

@MrHao123
Copy link
Author

嗯,确实是版本的问题。我更新了node17 ,electron18(内置node17)。但是我使用yarn add ffcreator安装,依旧会报错
yarn add v1.22.18 warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json. [1/4] Resolving packages... warning ffcreator > [email protected]: use String.prototype.padStart() warning ffcreator > get-pixels > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 warning ffcreator > inkpaint > [email protected]: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at <https://github.com/visionmedia/superagent/releases>. warning ffcreator > get-pixels > request > [email protected]: this library is no longer supported warning ffcreator > get-pixels > request > [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. warning ffcreator > inkpaint > gl > node-gyp > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 warning ffcreator > inkpaint > superagent > [email protected]: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau warning ffcreator > inkpaint > gl > prebuild-install > [email protected]: [WARNING] Use 1.0.0 instead of 1.1.0, reason: https://github.com/zkochan/packages/commit/e7af82f03f1afe6086312d80a0fa47eb8d1c6bff [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... [1/2] ⠄ canvas error D:\vue\test\node_modules\canvas: Command failed. Exit code: 1 Command: node-pre-gyp install --fallback-to-build Arguments: Directory: D:\vue\test\node_modules\canvas Output: node-pre-gyp info it worked if it ends with ok node-pre-gyp info using [email protected] node-pre-gyp info using [email protected] | win32 | x64 node-pre-gyp info check checked for "D:\vue\test\node_modules\canvas\build\Release\canvas.node" (not found) node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.9.1/canvas-v2.9.1-node-v93-win32-unknown-x64.tar.gz node-pre-gyp ERR! install request to https://github.com/Automattic/node-canvas/releases/download/v2.9.1/canvas-v2.9.1-node-v93-win32-unknown-x64.tar.gz failed, reason: read ECONNRESET node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v93 ABI, unknown) (falling back to source compile with node-gyp) node-pre-gyp WARN Hit error request to https://github.com/Automattic/node-canvas/releases/download/v2.9.1/canvas-v2.9.1-node-v93-win32-unknown-x64.tar.gz failed, reason: read ECONNRESET gyp info it worked if it ends with ok gyp info using [email protected] gyp info using [email protected] | win32 | x64 gyp info ok gyp info it worked if it ends with ok gyp info using [email protected] gyp info using [email protected] | win32 | x64 gyp info find Python using Python version 3.8.1 found at "D:\python3.8\python.exe" gyp ERR! find VS gyp ERR! find VS msvs_version was set from command line or npm config gyp ERR! find VS - looking for Visual Studio version 2019 gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt gyp ERR! find VS checking VS2017 (15.9.28307.1831) found at: gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools" gyp ERR! find VS - "Visual Studio C++ core features" missing gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use gyp ERR! find VS looking for Visual Studio 2015 gyp ERR! find VS - not found gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8 gyp ERR! find VS gyp ERR! find VS valid versions for msvs_version: gyp ERR! find VS gyp ERR! find VS ************************************************************** gyp ERR! find VS You need to install the latest version of Visual Studio gyp ERR! find VS including the "Desktop development with C++" workload. gyp ERR! find VS For more information consult the documentation at: gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows gyp ERR! find VS ************************************************************** gyp ERR! find VS gyp ERR! configure error gyp ERR! stack Error: Could not find any Visual Studio installation to use gyp ERR! stack at VisualStudioFinder.fail (D:\vue\test\node_modules\node-gyp\lib\find-visualstudio.js:122:47) gyp ERR! stack at D:\vue\test\node_modules\node-gyp\lib\find-visualstudio.js:75:16 gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (D:\vue\test\node_modules\node-gyp\lib\find-visualstudio.js:363:14) gyp ERR! stack at D:\vue\test\node_modules\node-gyp\lib\find-visualstudio.js:71:14 gyp ERR! stack at D:\vue\test\node_modules\node-gyp\lib\find-visualstudio.js:384:16 gyp ERR! stack at D:\vue\test\node_modules\node-gyp\lib\util.js:54:7 gyp ERR! stack at D:\vue\test\node_modules\node-gyp\lib\util.js:33:16 gyp ERR! stack at ChildProcess.exithandler (node:child_process:404:5) gyp ERR! stack at ChildProcess.emit (node:events:390:28) gyp ERR! stack at maybeClose (node:internal/child_process:1064:16) gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) gyp ERR! System Windows_NT 10.0.19044 gyp ERR! command "D:\\nvm\\nodejs\\node.exe" "D:\\vue\\test\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=D:\\vue\\test\\node_modules\\canvas\\build\\Release\\canvas.node" "--module_name=canvas" "--module_path=D:\\vue\\test\\node_modules\\canvas\\build\\Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93" "--msvs_version=2019" gyp ERR! cwd D:\vue\test\node_modules\canvas gyp ERR! node -v v16.13.0 gyp ERR! node-gyp -v v8.4.1 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute 'D:\nvm\nodejs\node.exe D:\vue\test\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=D:\vue\test\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=D:\vue\test\node_modules\canvas\build\Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93 --msvs_version=2019' (1) node-pre-gyp ERR! stack at ChildProcess.<anonymous> (D:\vue\test\node_modules\@mapbox\node-pre-gyp\lib\util\compile.js:89:23) node-pre-gyp ERR! stack at ChildProcess.emit (node:events:390:28) node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1064:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) node-pre-gyp ERR! System Windows_NT 10.0.19044 node-pre-gyp ERR! command "D:\\nvm\\nodejs\\node.exe" "D:\\vue\\test\\node_modules\\@mapbox\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd D:\vue\test\node_modules\canvas node-pre-gyp ERR! node -v v16.13.0 node-pre-gyp ERR! node-pre-gyp -v v1.0.9 node-pre-gyp ERR! not ok Failed to execute 'D:\nvm\nodejs\node.exe D:\vue\test\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=D:\vue\test\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=D:\vue\test\node_modules\canvas\build\Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93 --msvs_version=2019' (1)

@1039289948
Copy link

哥们你是怎么解决的?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants