renaesop / node-pdfium

Apache License 2.0
11 stars 5 forks source link

Can't install on Node v16.13 #12

Open themachho opened 2 years ago

themachho commented 2 years ago

npm -v 8.1.3 node -v v16.13.0

PS C:\Users\uservm\Documents\dev\myprogram\backEnd> npm i https://github.com/renaesop/node-pdfium
npm ERR! code 1
npm ERR! path C:\Users\uservm\Documents\dev\myprogram\backEnd\node_modules\node-pdfium
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.3.0
npm ERR! gyp info using node@16.13.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.0 found at "C:\Python310\python.exe"
npm ERR! gyp info find VS using VS2017 (15.9.28307.1705) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Python310\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'C:\\Users\\uservm\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'msvs',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\uservm\\Documents\\dev\\myprogram\\backEnd\\node_modules\\node-pdfium\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\uservm\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\uservm\\AppData\\Local\\node-gyp\\Cache\\16.13.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=C:\\Users\\uservm\\AppData\\Local\\node-gyp\\Cache\\16.13.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\uservm\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\uservm\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\16.13.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\uservm\\Documents\\dev\\myprogram\\backEnd\\node_modules\\node-pdfium',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'C:\\Users\\uservm\\Documents\\dev\\myprogram\\backEnd\\node_modules\\node-pdfium\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Traceback (most recent call last):n
npm ERR!   File "C:\Users\uservm\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 1191, in EvalSingleCondition
npm ERR!     ast_code = compile(cond_expr_expanded, "<string>", "eval")
npm ERR!   File "<string>", line 1
npm ERR!     "C:\Users\uservm\Documents\dev\myprogram\backEnd\node_modules\node-pdfium\x64" == ""
npm ERR!                                                                                                                  ^^
npm ERR! SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
npm ERR!
npm ERR! During handling of the above exception, another exception occurred:
npm ERR!
npm ERR! Traceback (most recent call last):
npm ERR!   File "C:\Users\uservm\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 45, in <module>
npm ERR!     sys.exit(gyp.script_main())
npm ERR!   File "C:\Users\uservm\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 662, in script_main
npm ERR!     return main(sys.argv[1:])
npm ERR!   File "C:\Users\uservm\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 654, in main
npm ERR!     return gyp_main(args)
npm ERR!   File "C:\Users\uservm\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 621, in gyp_main
npm ERR!     [generator, flat_list, targets, data] = Load(
npm ERR!   File "C:\Users\uservm\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 142, in Load
npm ERR!     result = gyp.input.Load(
npm ERR!   File "C:\Users\uservm\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 3009, in Load
npm ERR!     LoadTargetBuildFile(
npm ERR!   File "C:\Users\uservm\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 427, in LoadTargetBuildFile
npm ERR!     ProcessVariablesAndConditionsInDict(
npm ERR!   File "C:\Users\uservm\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 1411, in ProcessVariablesAndConditionsInDict
npm ERR!     ProcessVariablesAndConditionsInList(value, phase, variables, build_file)
npm ERR!   File "C:\Users\uservm\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 1424, in ProcessVariablesAndConditionsInList
npm ERR!     ProcessVariablesAndConditionsInDict(item, phase, variables, build_file)
npm ERR!   File "C:\Users\uservm\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 1327, in ProcessVariablesAndConditionsInDict
npm ERR!     ProcessVariablesAndConditionsInDict(
npm ERR!   File "C:\Users\uservm\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 1385, in ProcessVariablesAndConditionsInDict
npm ERR!     ProcessConditionsInDict(the_dict, phase, variables, build_file)
npm ERR!   File "C:\Users\uservm\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 1249, in ProcessConditionsInDict
npm ERR!     merge_dict = EvalCondition(
npm ERR!   File "C:\Users\uservm\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 1165, in EvalCondition
npm ERR!     result = EvalSingleCondition(
npm ERR!   File "C:\Users\uservm\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 1206, in EvalSingleCondition
npm ERR!     raise syntax_error
npm ERR! SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape while evaluating condition '"C:\Users\uservm\Documents\dev\myprogram\backEnd\node_modules\node-pdfium\x64" == ""' in binding.gyp at character 110.
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\uservm\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:261:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\uservm\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\uservm\Documents\dev\myprogram\backEnd\node_modules\node-pdfium
npm ERR! gyp ERR! node -v v16.13.0
npm ERR! gyp ERR! node-gyp -v v8.3.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\uservm\AppData\Local\npm-cache\_logs\2022-02-17T19_05_07_690Z-debug.log

Any ideas?