最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Error while parsing config - JSON5: invalid end of input at 1:1 at syntaxError - Stack Overflow

programmeradmin0浏览0评论

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.

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.

Share Improve this question edited Dec 14, 2022 at 18:28 Inigo 15k5 gold badges50 silver badges81 bronze badges asked May 14, 2020 at 1:03 PotatodragonPotatodragon 1961 gold badge3 silver badges5 bronze badges
Add a comment  | 

3 Answers 3

Reset to default 15

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: {}

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.

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

发布评论

评论列表(0)

  1. 暂无评论