2

I have tried using the node_modules/.bin/babel before.js -o after.js command to convert from es6 to compatible js. I also had to run set-executionpolicy remotesigned on windows powershell to fix error cannot be loaded because running
scripts is disabled on this system. As it stands the node_modules/.bin/babel before.js -o after.js command is throwing

SyntaxError (file directory link) Error while parsing config - JSON5: invalid end of input at 1:1.

Inigo
  • 12,186
  • 5
  • 41
  • 70
Potatodragon
  • 141
  • 1
  • 2
  • 5

3 Answers3

13

I had the same problem and I find out that it's because I have an empty Json file it was for babel.config.json (or .babelrc).

It works with the following content instead: {}

hb0
  • 3,350
  • 3
  • 30
  • 48
1

It seems that the problem was caused by my Execution policy being restricted. For those who are concerned with similar problems. Similar errors like the one above can be fixed by opening Windows PowerShell as administrator and running command Get-ExecutionPolicy -Scope CurrentUser and finding out if your script access is unrestricted. If it isn't then the following command can be used Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachine followed by the Y or N answering of the question and you're set.

Potatodragon
  • 141
  • 1
  • 2
  • 5
  • `Get-ExecutionPolicy -Scope CurrentUser` returns `undefined` – vsync Dec 28 '20 at 17:31
  • I got the same error and after doing this it worked. Thank you for getting this answer man! Question for you: When I ran `Get-ExecutionPolicy -Scope CurrentUser` all that happened was `undefined` was returned. I chose to run the next command regardless and accepted 'all access' (paraphrased). Did you also get `undefined` @vsync? – Matthew Wolman Mar 28 '21 at 02:12
0

add in .babelrc file, in object {}, with key "presents": and value - all babel dependesies from your package.json. Helped for me