sveltejs / svelte-cli

Command line interface for Svelte
MIT License
104 stars 18 forks source link

Cannot compile due to error: TypeError: path must be a string or Buffer in binding.stat(pathModule._makeLong(path)); #27

Open louwers opened 6 years ago

louwers commented 6 years ago

A fresh installation of svelte-cli fails to compile anything.

Stack trace ``` $ svelte compile --iife ./HelloWorld.html > HelloWorld.js svelte version 1.41.1 fs.js:955 binding.stat(pathModule._makeLong(path)); ^ TypeError: path must be a string or Buffer at Object.fs.statSync (fs.js:955:11) at compile$1 (/home/me/.node_modules/lib/node_modules/svelte-cli/bin.js:559:19) at Object. (/home/me/.node_modules/lib/node_modules/svelte-cli/bin.js:707:3) at Module._compile (module.js:624:30) at Object.Module._extensions..js (module.js:635:10) at Module.load (module.js:545:32) at tryModuleLoad (module.js:508:12) at Function.Module._load (module.js:500:3) at Function.Module.runMain (module.js:665:10) at startup (bootstrap_node.js:187:16) ```

Versions

$ node -v
v8.7.0
$ svelte -v
svelte-cli version 1.4.0
svelte version 1.41.1
louwers commented 6 years ago

My bad for using a wrong flag... Still that's a very weird error. Adding a check to see if the flag is recognized might be a good idea.