Reputation: 75
I wanted to start working on React today, and I found this tutorial to help me setting up my environment:
https://www.kirupa.com/react/setting_up_react_environment.htm
Everything went well, up to the point where I am supposed to install webpack: npm just nope me. I absolutly don't know how to fix this.
I tried two commands to install Webpack:
This one, in the tutorial: npm install webpack --save
and this one, coming from npmjs.com: npm install --save-dev webpack
Both return the same errors, which are the following:
C:\Users\Me\Desktop\MyAwesomeApp>npm install --save-dev webpack
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program
Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save-dev"
"webpack"
npm ERR! node v7.5.0
npm ERR! npm v4.1.2
npm ERR! file C:\Users\Me\AppData\Roaming\npm-cache\core-util
is\1.0.2\package\package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token '�' at 1:1
npm ERR! �D$� I�D$�I�D$�I�D$� I�L$�I�D$� I�D$�I�D$�I�D$� I�$
I�\$�H��8�e
npm ERR! ^
npm ERR! File: C:\Users\Me\AppData\Roaming\npm-cache\core-util
is\1.0.2\package\package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Me\Desktop\MyAwesomeApp\npm-debug.log
If anyone know how to fix this problem, or know a setting up tutorial that works for sure, I would be glad, React seems really interesting to learn.
Thanks in advance.
Upvotes: 0
Views: 7153
Reputation: 8220
There problems in package.json
at installed package, your log dump:
C:\Users\Me\AppData\Roaming\npm-cache\core-utilis\1.0.2\package\package.json
package.json must be actual JSON, not just JavaScript
Check it content (may be usefull any online json validator. I have seen special package.json
validators)
The package.json
must be plain JSON
format file.
Seems it corrupt. Mey be need to reinstall. Do you have mirrored double drive hard disk or may be file system corrupted. May be some package installation process was interrupted.
The package.json description for references.
Upvotes: 0
Reputation: 664
Try running npm cache clean
and then install webpack again
.Check for trailing commas in any of the objects in your package.json
mostly under 'dependencies' object.
Upvotes: 6