Error Occurs With installing .Babelrc

I am currently using atom text editor and gitbash as my terminal. My laptop is a lenovo and supports windows

There is an error that occurs during npm run build. Does anyone know the solution to this issue? The error is below. Thank you.

$ npm run build

[email protected] build C:\projects\minesweeper
babel src -d lib

SyntaxError: C:\projects\minesweeper\src.babelrc: Error while parsing JSON - Syntax error at line 4 column 1 of the JSON5 data. Still to read: “"name": "minesweeper”
at error (C:\Projects\minesweeper\node_modules\json5\lib\json5.js:56:25)
at Object.parse (C:\Projects\minesweeper\node_modules\json5\lib\json5.js:511:13)
at ConfigChainBuilder.addConfig (C:\Projects\minesweeper\node_modules\babel-core\lib\transformation\file\options\build-config-chain.js:150:65)
at ConfigChainBuilder.findConfigs (C:\Projects\minesweeper\node_modules\babel-core\lib\transformation\file\options\build-config-chain.js:96:16)
at buildConfigChain (C:\Projects\minesweeper\node_modules\babel-core\lib\transformation\file\options\build-config-chain.js:61:13)
at OptionManager.init (C:\Projects\minesweeper\node_modules\babel-core\lib\transformation\file\options\option-manager.js:354:58)
at File.initOptions (C:\Projects\minesweeper\node_modules\babel-core\lib\transformation\file\index.js:212:65)
at new File (C:\Projects\minesweeper\node_modules\babel-core\lib\transformation\file\index.js:135:24)
at Pipeline.transform (C:\Projects\minesweeper\node_modules\babel-core\lib\transformation\pipeline.js:46:16)
at transform (C:\Projects\minesweeper\node_modules\babel-cli\lib\babel\util.js:50:22)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: babel src -d lib
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Nick\AppData\Roaming\npm-cache_logs\2018-04-10T21_32_07_309Z-debug.log

Your error message states the problem, a closer look perhaps? Seems like you gave up before reading it.

1 Like

You were right ionatan. The error turned out to be in the .babelrc file. I had too much code in there. When I deleted the extra code. I forgot to savevthe file again. So when I typed the command npm run build. I was looking at the updated .babelrc file. when I closed everything and reopened the file I realized I did not save the updated code. I did this with the help of some codecademy advisors.

1 Like