monotosh-k / gcp-docs

Download Google Cloud Platform's docs in PDF format
23 stars 15 forks source link

./bin/gcp-docs fails on missing module esm #7

Open cvalcarcel opened 1 year ago

cvalcarcel commented 1 year ago

OS: RedHat 9.1 (running on VirtualBox)

When I run './bin/gcp-docs' after downloading the repo i get a cascade of errors about a missing esm package. It turns out the versions needed of various modules for gcp-docs are rather old at this point and I am not sure what I should do to correct it.

$ ./bin/gcp-docs node:internal/modules/cjs/loader:988 throw err; ^

Error: Cannot find module 'esm' Require stack:

When I try to load module esm I get: $ npm i esm npm WARN old lockfile npm WARN old lockfile The package-lock.json file was created with an old version of npm, npm WARN old lockfile so supplemental metadata must be fetched from the registry. npm WARN old lockfile npm WARN old lockfile This is a one-time fix-up, please be patient... npm WARN old lockfile npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.) npm WARN deprecated puppeteer@1.18.1: < 19.4.0 is no longer supported npm ERR! code 1 npm ERR! path /home/carlos/Documents/r-and-d/github/gcp-docs-master/node_modules/hummus npm ERR! command failed npm ERR! command sh -c node-pre-gyp install --fallback-to-build $EXTRA_NODE_PRE_GYP_FLAGS npm ERR! make: Entering directory '/home/carlos/Documents/r-and-d/github/gcp-docs-master/node_modules/hummus/build' npm ERR! CXX(target) Release/obj.target/pdfwriter/src/deps/PDFWriter/AbstractContentContext.o npm ERR! make: Entering directory '/home/carlos/Documents/r-and-d/github/gcp-docs-master/node_modules/hummus/build' npm ERR! CXX(target) Release/obj.target/pdfwriter/src/deps/PDFWriter/AbstractContentContext.o npm ERR! CXX(target) Release/obj.target/pdfwriter/src/deps/PDFWriter/AbstractWrittenFont.o [And an incredible number of error messages that probably don't mean anything]

Not sure what to do to fix this. I have tried running it with and without sudo and the errors are the same.

cvalcarcel commented 1 year ago

Fixed the issue by configuring the global dependency location (/usr/local/node_modules) for npm to be local, and running 'npm link' in the gcp-docs-master/bin directory. Of course, gcp-docs doesn't print any pdfs after giving it a product name, but that is a different problem.

dhaijma commented 1 year ago

@cvalcarcel have you managed to fix the pdf printing? Many thanks!