svgexport
svgexport copied to clipboard
The "file" argument must be of type string. Received type object
anudorannador@ArchOffice:~/Desktop|⇒ svgexport "$PWD/test.svg" "$PWD/test.png" 1.5x
internal/validators.js:125
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object
at validateString (internal/validators.js:125:11)
at normalizeSpawnArguments (child_process.js:394:3)
at Object.spawn (child_process.js:532:38)
at render (/usr/lib/node_modules/svgexport/index.js:124:26)
at Object.cli (/usr/lib/node_modules/svgexport/index.js:24:5)
at Object.<anonymous> (/usr/lib/node_modules/svgexport/bin/index.js:2:16)
at Module._compile (internal/modules/cjs/loader.js:707:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
at Module.load (internal/modules/cjs/loader.js:605:32)
at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
anudorannador@ArchOffice:~/Desktop|⇒ npm ls phantomjs-prebuilt -g
/usr/lib
├─┬ [email protected]
│ └── [email protected]
├── [email protected]
└─┬ [email protected]
└── [email protected]
anudorannador@ArchOffice:~/Desktop|⇒ node -v
v11.1.0
I am new to use this, and I tried many SVG file but same error, so is there anyone can help me to figure out the problem ?
have you figured it out?
No, no me but some one helped. see more about this issue. but there are some Chinese.
Wait sorry, can you help me understand what made it work for you? Can't read Chinese haha
in short, cause of phantomjs
is deprecated, replaced by phantomjs-prebuilt
, but svgexport
has not updated, still using phantomjs
.
The reason why the error occurs because I linked the phantomjs-prebuilt
as phantomjs
and, finally, failed.
So, I unlinked phantomjs-prebuilt
and re-install svgexport
with command:
sudo npm install -g svgexport --unsafe-perm
the argument --unsafe-perm
to force to install svgexport
and the deprecated dependency, phantomjs
.
I also think that svgexport
is deprecated : )
Same issue here.
svgexport ltc.svg output.png internal/validators.js:125 throw new ERR_INVALID_ARG_TYPE(name, 'string', value); ^
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object
at validateString (internal/validators.js:125:11)
at normalizeSpawnArguments (child_process.js:399:3)
at Object.spawn (child_process.js:532:38)
at render (/usr/local/lib/node_modules/svgexport/index.js:124:26)
at Object.cli (/usr/local/lib/node_modules/svgexport/index.js:24:5)
at Object.