Closed zedtux closed 6 years ago
Hmmm - thanks for the report. Are you sure this is necessary. Running the same on a clean node:6 docker image I can clone the repo and run npm install without problems. Are you sure this is not because of some conflicting local .ssh or .git settings? That said - the build actually does not work for me ATM. I get a problem with the browserify step in my clean docker image. @HackbrettXXX - can you double-check?
I'm missing the .map
file, and before running npm run build
, I need to install the dependencies.
I'm running a debian Jessie Docker image with my app which has a dependency on this library, so I have no configured .ssh or .git settings.
Your node version is from the stone-age. Are you sure you want to be running npm 1.4?
$ docker run -it --rm node:6 bash root@4954590953a5:/# mkdir test && cd test root@4954590953a5:/test# git clone https://github.com/yWorks/jsPDF Cloning into 'jsPDF'... remote: Counting objects: 6598, done. remote: Total 6598 (delta 0), reused 0 (delta 0), pack-reused 6598 Receiving objects: 100% (6598/6598), 46.96 MiB | 5.81 MiB/s, done. Resolving deltas: 100% (3685/3685), done. Checking connectivity... done. root@4954590953a5:/test# cd jsPDF/ root@4954590953a5:/test/jsPDF# npm install jspdf-yworks@1.3.1 /test/jsPDF +-- accepts@1.3.3 +-- adler32cs@0.0.1 (git://github.com/chick307/adler32cs.js.git#c6576b4ed91b4216973bf85d8478a49970934515) +-- align-text@0.1.4 +-- amdefine@1.0.1
Well I'm following what is running in prod right now. It is true it is a very old version, but unfortunately I can't upgrade it for now (I'm adding tests on the app before to migrate anything). 😞
The build works with a decently recent version of npm and node: It is indeed missing a dependency on bower and bower only works in the official node docker image if you su node
before you do anything, so I don't see the need to support node0.x anymore.
Is there another way to get this .map
file?
Yes, there is: build it on a separate server that uses a current version of npm. Sorry, I don't think we should start supporting years old environments. You should update instead, IMHO.
Thank you @yGuy I will do it in a Docker container 👍.
Within the svg2pdf.js folder:
docker run -it --rm -v "$PWD":/devs -w /devs node:6 bash
npm install
npm run build
Then I copied the .map
files. Thank you @yGuy.
@yGuy I just tested the build. On a fresh clone it works locally on my PC. However, if I run it in a Docker, the build fails:
Error: Cannot find module 'SvgPath' from '/src'
at /node_modules/browser-resolve/node_modules/resolve/lib/async.js:46:17
at process (/node_modules/browser-resolve/node_modules/resolve/lib/async.js:173:43)
at ondir (/node_modules/browser-resolve/node_modules/resolve/lib/async.js:188:17)
at load (/node_modules/browser-resolve/node_modules/resolve/lib/async.js:69:43)
at onex (/node_modules/browser-resolve/node_modules/resolve/lib/async.js:92:31)
at /node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47
at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR! Linux 4.9.60-linuxkit-aufs
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "browserify"
npm ERR! node v6.13.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! svg2pdf.js@1.2.0 browserify: `browserify src/svg2pdf.js --debug -p licensify -s svg2pdf -o dist/svg2pdf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the svg2pdf.js@1.2.0 browserify script 'browserify src/svg2pdf.js --debug -p licensify -s svg2pdf -o dist/svg2pdf.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the svg2pdf.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! browserify src/svg2pdf.js --debug -p licensify -s svg2pdf -o dist/svg2pdf.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs svg2pdf.js
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls svg2pdf.js
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /npm-debug.log
npm ERR! Linux 4.9.60-linuxkit-aufs
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v6.13.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! svg2pdf.js@1.2.0 build: `npm run browserify && npm run exorcist:svg2pdf && npm run uglify:dist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the svg2pdf.js@1.2.0 build script 'npm run browserify && npm run exorcist:svg2pdf && npm run uglify:dist'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the svg2pdf.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run browserify && npm run exorcist:svg2pdf && npm run uglify:dist
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs svg2pdf.js
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls svg2pdf.js
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /npm-debug.log
The reason seems to be that browserify cannot resolve the "SvgPath"-dependency. A quick search didn't yield any solutions. I'll have a look at it again, soon.
@HackbrettXXX - browserify will refuse to run under root - did you do a su node? Did you run all of this inside the docker instance or using a volume mapped to you local checkout? My last tests with node:6 succeeded.
I ran it on a mapped folder and without "su node" (so probably as root, I'm no docker expert). But if it works for you now, I guess everything is fine.
Running
npm install
from the svg2pdf.js package fails with: