svelte-cli icon indicating copy to clipboard operation
svelte-cli copied to clipboard

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

Open louwers opened this issue 8 years ago • 1 comments

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.<anonymous> (/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 avatar Oct 27 '17 12:10 louwers

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.

louwers avatar Oct 27 '17 12:10 louwers