Pdf password protection not installing in the project
-
Hey, I am trying to password protect my PDFs using one of your platform-suggested libraries
https://www.npmjs.com/package/jsreport-pdf-password?activeTab=readme
Everytime I try to install it, I get this error.npm ERR! code 1 npm ERR! path D:\chrome-pdf\GIT_REPO\project-report-server\node_modules\hummus npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build $EXTRA_NODE_PRE_GYP_FLAGS npm ERR! 'node-pre-gyp' is not recognized as an internal or external command, npm ERR! operable program or batch file. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\user1\AppData\Local\npm-cache\_logs\2023-09-06T03_33_09_562Z-debug-0.log
I installed node-gyp too and got a different set of error.
npm ERR! code 1 npm ERR! path D:\chrome-pdf\GIT_REPO\project-report-server\node_modules\hummus npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build $EXTRA_NODE_PRE_GYP_FLAGS npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\user1\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build=$EXTRA_NODE_PRE_GYP_FLAGS --module=D:\chrome-pdf\GIT_REPO\project-report-server\node_modules\hummus\binding\hummus.node --module_name=hummus --module_path=D:\chrome-pdf\GIT_REPO\project-report-server\node_modules\hummus\binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1) npm ERR! node-pre-gyp info it worked if it ends with ok npm ERR! node-pre-gyp info using node-pre-gyp@0.17.0 npm ERR! node-pre-gyp info using node@16.15.0 | win32 | x64 npm ERR! node-pre-gyp WARN Using needle for node-pre-gyp https download npm ERR! node-pre-gyp info check checked for "D:\chrome-pdf\GIT_REPO\project-report-server\node_modules\hummus\binding\hummus.node" (not found) npm ERR! node-pre-gyp http GET https://hummus.s3-us-west-2.amazonaws.com/hummus/v1.0.108/node-v93-win32-x64-unknown.tar.gz npm ERR! node-pre-gyp http 404 https://hummus.s3-us-west-2.amazonaws.com/hummus/v1.0.108/node-v93-win32-x64-unknown.tar.gz npm ERR! node-pre-gyp WARN Tried to download(404): https://hummus.s3-us-west-2.amazonaws.com/hummus/v1.0.108/node-v93-win32-x64-unknown.tar.gz npm ERR! node-pre-gyp WARN Pre-built binaries not found for hummus@1.0.108 and node@16.15.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp) npm ERR! node-pre-gyp http 404 status code downloading tarball https://hummus.s3-us-west-2.amazonaws.com/hummus/v1.0.108/node-v93-win32-x64-unknown.tar.gz npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.1.0 npm ERR! gyp info using node@16.15.0 | win32 | x64 npm ERR! gyp info ok npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.1.0 npm ERR! gyp info using node@16.15.0 | win32 | x64 npm ERR! gyp info find Python using Python version 3.10.11 found at "C:\Users\user1\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe" npm ERR! gyp ERR! find VS npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details npm ERR! gyp ERR! find VS looking for Visual Studio 2015 npm ERR! gyp ERR! find VS - not found npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8 npm ERR! gyp ERR! find VS npm ERR! gyp ERR! find VS ************************************************************** npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload. npm ERR! gyp ERR! find VS For more information consult the documentation at: npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows npm ERR! gyp ERR! find VS ************************************************************** npm ERR! gyp ERR! find VS npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use npm ERR! gyp ERR! stack at VisualStudioFinder.fail (C:\Users\user1\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47) npm ERR! gyp ERR! stack at C:\Users\user1\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:75:16 npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\user1\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:364:14) npm ERR! gyp ERR! stack at C:\Users\user1\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:71:14 npm ERR! gyp ERR! stack at C:\Users\user1\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:385:16 npm ERR! gyp ERR! stack at C:\Users\user1\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7 npm ERR! gyp ERR! stack at C:\Users\user1\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16 npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:406:5) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:527:28) npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1092:16) npm ERR! gyp ERR! System Windows_NT 10.0.22621 npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user1\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build=$EXTRA_NODE_PRE_GYP_FLAGS" "--module=D:\\chrome-pdf\\GIT_REPO\\project-report-server\\node_modules\\hummus\\binding\\hummus.node" "--module_name=hummus" "--module_path=D:\\chrome-pdf\\GIT_REPO\\project-report-server\\node_modules\\hummus\\binding" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93" npm ERR! gyp ERR! cwd D:\chrome-pdf\GIT_REPO\project-report-server\node_modules\hummus npm ERR! gyp ERR! node -v v16.15.0 npm ERR! gyp ERR! node-gyp -v v9.1.0 npm ERR! gyp ERR! not ok npm ERR! node-pre-gyp ERR! build error npm ERR! node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\user1\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build=$EXTRA_NODE_PRE_GYP_FLAGS --module=D:\chrome-pdf\GIT_REPO\project-report-server\node_modules\hummus\binding\hummus.node --module_name=hummus --module_path=D:\chrome-pdf\GIT_REPO\project-report-server\node_modules\hummus\binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1) npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\user1\AppData\Roaming\npm\node_modules\node-pre-gyp\lib\util\compile.js:83:29) npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:527:28) npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1092:16) npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.22621 npm ERR! node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user1\\AppData\\Roaming\\npm\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" "$EXTRA_NODE_PRE_GYP_FLAGS" npm ERR! node-pre-gyp ERR! cwd D:\chrome-pdf\GIT_REPO\project-report-server\node_modules\hummus npm ERR! node-pre-gyp ERR! node -v v16.15.0 npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.17.0 npm ERR! node-pre-gyp ERR! not ok npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\user1\AppData\Local\npm-cache\_logs\2023-09-06T03_43_27_858Z-debug-0.log
Why am I getting this error? How do I sort this out?
-
This is an old repo.... jsreport has now in the default installation the native js implemented password protection. Just install the latest jsreport and check the docs
https://jsreport.net/on-prem
https://jsreport.net/learn/pdf-utils#password-protection