Wednesday 26 April 2017

Babel: Path must be a string. Received true using es2017

This is the error what I have

TypeError: Path must be a string. Received true
    at assertPath (path.js:7:11)
    at Object.dirname (path.js:695:5)
    at C:\xampp\htdocs\npm-codes\node_modules\babel-cli\lib\babel\file.js:138:45
    at Array.forEach (native)
    at walk (C:\xampp\htdocs\npm-codes\node_modules\babel-cli\lib\babel\file.js:133:16)
    at files (C:\xampp\htdocs\npm-codes\node_modules\babel-cli\lib\babel\file.js:156:7)
    at module.exports (C:\xampp\htdocs\npm-codes\node_modules\babel-cli\lib\babel\file.js:184:5)
    at Object.<anonymous> (C:\xampp\htdocs\npm-codes\node_modules\babel-cli\lib\babel\index.js:129:1)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)

This is my cli command that will output an app.js that converted from ES6 to es2017 as expected. I already done this in es2015 and it was successful, but after I move to es2017 the error above appear after I run the cli command.

I want to know what is missing or wrong in my cli command. Below is my cli command.

babel index.js -w -o -s dist/app.js --presets es2017

I already install babel-cli and babel-preset-es2017 in my machine.



via John Rey M. Baylen

No comments:

Post a Comment