Once I've successfully set up react
and react-dom
, the next step is to install webpack
. However, I encountered an error during this process.
To troubleshoot, I decided to install babel-loader
first to ensure that both npm and my internet connection are working correctly. Surprisingly, it installed without any issues.
Here's a snippet of the log:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\motamed\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'webpack',
1 verbose cli '--save-dev' ]
2 info using <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="afc1dfc2ef99819f819e">[email protected]</a>
3 info using <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ef81808b8aaf99dedfc1ded9c1dc">[email protected]</a>
...
428 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...","mocha":"^3.2.0","s'
428 verbose stack at JSON.parse (<anonymous>)
428 verbose stack at parseJson (C:\Users\motamed\AppData\Roaming\npm\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
428 verbose stack at consumeBody.call.then.buffer (C:\Users\motamed\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\body.js:96:50)
428 verbose stack at process._tickCallback (internal/process/next_tick.js:68:7)
429 verbose cwd I:\RN\rn
430 verbose Windows_NT 6.1.7600
431 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\motamed\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "webpack" "--save-dev"
432 verbose node v10.16.3
433 verbose npm v6.0.1
434 error Unexpected end of JSON input while parsing near '...","mocha":"^3.2.0","s'
435 verbose exit [ 1, true ]