Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "file" argument must be of type string. Received type object #64

Open
Anudorannador opened this issue Nov 8, 2018 · 5 comments
Open

Comments

@Anudorannador
Copy link

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
├─┬ phantom@6.0.3
│ └── phantomjs-prebuilt@2.1.16 
├── phantomjs-prebuilt@2.1.16 
└─┬ svgexport@0.3.2
  └── phantomjs-prebuilt@2.1.16 
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 ?

@MarksCode
Copy link

have you figured it out?

@Anudorannador
Copy link
Author

No, no me but some one helped.
see more about this issue.
but there are some Chinese.

@MarksCode
Copy link

Wait sorry, can you help me understand what made it work for you? Can't read Chinese haha

@Anudorannador
Copy link
Author

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 : )

@jaggedsoft
Copy link

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. (/usr/local/lib/node_modules/svgexport/bin/index.js:2:16)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants