facebook / react

The library for web and native user interfaces.
https://react.dev
MIT License
228.27k stars 46.7k forks source link

npm install --save react-dom throws error #6421

Closed vajrasky closed 8 years ago

vajrasky commented 8 years ago

$ npm install --save react-dom npm http GET http://registry.npmjs.org/react-dom npm http 200 http://registry.npmjs.org/react-dom npm ERR! registry error parsing json npm ERR! SyntaxError: Unexpected token  npm ERR! �Y�n�F�B��(�/z2���@�iҗ�u�2+�M�������~Iϒ�.�jI�� �dK�;;�3s� ��W�b(��>K�,I"�H�ga�G1ϗQ�Lz!�lF�%����U��7vg�f��M�QU��U͍.'Νn�N;%��o�]l%�i�-������-����Gnf5�G�ۏ]����p�����-5�:,u=+�è��~C���-3a���Ü��.~p�V��������c���D�o�Xt��!ǰR� ���awd�9S* h����i�lX�s��,���fl��� �E��%Du5s��k���n�fawh�u�D���7Vjڶ��F�ι+��h���Vau� ��¸�8\�����QGژ9��ЂJcu���-���r@"f���ØM�?/��M����և�n_QM��Rh� W�Jڍ�.)8�,��N�� npm ERR! ��B���٥����UQ!DvY�'S�������T��#S��'z��>���֙)3��ND/~&�He$�< g�fL���-�ٵq�f��h��>�Ի��Sg�j����B� npm ERR! �����ۃ��w�v$%r�Of��P��������I������!|[�y �W�tV_Q\�p��Y�w�we� �M�)�8vdA[)����ئ fH^8u��ѥi1C�:8���k��=��l#�>߾ �V��&������8�ˬ�3'.����� {H�a+(&�W�M�6�|���?��j*��=��lP�Ӽ�@�m�F3fZj�p��H�-���GmE���22����r���G��/�h�7�v��1��Lʘ�G�H<����(�� npm ERR! ϓ�Ra�q[�P>MU�v٭tAc>ׅ-+�Yö,�/��o���g��3�'xnw�0nj-ט��7��fKUkK�u���� �|�Y���f�Ⲃ3Q��Y���h��o��n>�.WQ�gM���{p �� ��ڌ��xWÑ�b$�����T��\�@�I�@x��C���i?? ��$��� R����B/�~��e7 ���C�^h����]z��k���ODz�u��"��2z⾟s�\�<�N�L��!��� ��O�\�I $'��a�q�sJ�s���~-̏p��0G�����������O�'�6ȫ��D@i0�2�$󼜥 .�����eQn�;^������z��%�� �{�����ɘރ� ��X�{�v�>��m����<ͳؓ���-Ty.T�e��i�d.)��g/������[�n�@�������<��ڛƝ�����5Q�� npm ERR! ��3�N'Nc����%�+�q����d9�g�s��0=�ʵ���&2k+��(�+��sҌ��\J)��Bx΂��&!�@�A[��/x�&L���n)��8�gT��cd��v��M|���ē��iYw�.#�۽#)_�(ph|@ a٪&��;&UЙ㢻w���s�ٳ�$]��|WơϹ��b"�[z�]l@)������%��?ؽ�3�gT��j�z��������sZ�a:߭�-u�Ip��V6ܘd1$k��dh��M���&c[��C��u��m+3�\ j}�d�?��&������}7�z ���W(���郞�N*֐V�(��R{�Ddx� kT$v͗N����&�e�}�>�f5&dZ�c��[�Q������k-��t�>'Ԏ�<�������ш $ki��&i���i[x

                                                                   �v��ڑ=�䥵

'���O�׏6��a��܅�=e7r�%�l`�����FE?"�7������'� ��S6�/�>���S4n|���]g����6Я�K{A(^�Xfܕ�V��M�U>8}�8���[���#e��o��J���C��PXu��8���2�1 npm ERR! #�|"ݓOq����=�TF rJ�}[+�Fc,�SQ�[Mj\�?�c�A���k�*�Z�7�����y/gQ��� #��Ab$����ԡ�bڟ��mq���,w��{�����\�n�F�"~�D4ﷺA�6E���HT(X+�i�K������%w%+N�q�b������,9�]Ξ��u�RV�`��$��lV��Z�^ M(�����#��*�@}l�T��ٶ���� ��JV/gt�|��&Ez�挿�Y�]�]��2=5ʣ�I�&" npm ERR! �SD L��=�qDD��\����l|O�8"��������y�������8��~�f�M�:���X�=�}s��f�p���mx���7�8�D��#��#������L��"��D>oڄ#r���)腖����ڔ�(�ín�&6*l��q��t�|0�1'�T���t�'|���Aƈ���eiSL�A���*��}��1 ��xOBM�2+�f��]��A..$Z[�QװrNv�39[�z��qO,�R��w@Q��r���ۥ4�� $�:i{r�]�"禮�t�d�}��τ� ��[��d��D �fu��僰�f�׬h/���L8}.����w{����A�� � �4�����\U�����4�p}�;������hQ��j��'���۴(���.��3����W�[�O�r�!�ů��5����H���igI������������A��r�/G�� 7�����xYu�U�y�8����)b npm ERR! � _!��V��D�)�"ʶ9E��ge���\�~X��� {d�cӋ�0rQ����e1��'������f�ad{��Bp�V ʎa�7�H�d[��5�u�D=�� H�eF����:RA�I�%.�YkX8 LWX+��%.Pql��c]�  �!ˊRR! v�_9�X����me���4G�5&��j8]�4:G5������EN������.�� �t6�@aP�t�q��ׂg) ����>�؂�,�鶒���fk��N$n �M%m�<��� # �x�٭�g�[Ɔ�pCwl!l<&�&4��@�����ؿ�ըܯxM�3� ��ץ,�W62�s;|�y����%r��@�3,�߽�����^R�"������"�X3� h�.�Y�%��o�R]����o�7��N������A���l�g`��E'l�'1>@�Կ���1�}�x����a���Y�nPe-�7K�c<��fö���̨�W7�l)�뤪g��D����c�z��%g�j����d3]3n)����N�4������Y UX���y�*wc��'�c%e�֛�Ҡ��Th��YëVY~S[:��[��ހ�0���� npm ERR! ��� �����*���l���^Yց�h �a|D�^��|�P6��D���jd�yz�T�}K��\!�a7,]����Q��󟼎����r�Ԡ��kֶ,�J�yt��� npm ERR! at Object.parse (native) npm ERR! at RegClient. (/usr/share/npm/node_modules/npm-registry-client/lib/request.js:238:23) npm ERR! at Request.self.callback (/usr/lib/nodejs/request/index.js:148:22) npm ERR! at Request.EventEmitter.emit (events.js:98:17) npm ERR! at Request. (/usr/lib/nodejs/request/index.js:896:14) npm ERR! at Request.EventEmitter.emit (events.js:117:20) npm ERR! at IncomingMessage. (/usr/lib/nodejs/request/index.js:847:12) npm ERR! at IncomingMessage.EventEmitter.emit (events.js:117:20) npm ERR! at _stream_readable.js:920:16 npm ERR! at process._tickCallback (node.js:415:13) npm ERR! If you need help, you may report this log at: npm ERR! http://github.com/isaacs/npm/issues npm ERR! or email it to: npm ERR! npm-@googlegroups.com

npm ERR! System Linux 3.19.0-56-generic npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "react-dom" npm ERR! cwd /home/karir/Code/latihan/reactjs npm ERR! node -v v0.10.25 npm ERR! npm -v 1.3.10 npm ERR! type unexpected_token npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/karir/Code/latihan/reactjs/npm-debug.log npm ERR! not ok code 0

The problem is the json in http://registry.npmjs.org/react-dom has some funny characters:

{"_id":"react-dom","_rev":"74-1a738664f6df983414e4a01d482b8d03","name":"react-dom","description":"React package for working with the DOM.","dist-tags":{"latest":"0.14.8","next":"15.0.0-rc.2"},"versions":{"0.1.0":{"name":"react-dom","version":"0.1.0","description":"DOM is a React.DOM wrapper with — subjectively — more sanity and awesome helpers","author":....

The funny characters are located beside the word "subjectively".

$ npm --version 1.3.10 $ nodejs --version v0.10.25

mijamo commented 8 years ago

Update your node and NPM version and everything will be fine, your version is more than 2 years old and in JS it is an eternity.

vajrasky commented 8 years ago

Understood. If that is the case, perhaps we should add the note in the documentation located in https://facebook.github.io/react/docs/getting-started.html. I am using default nodejs and npm from Ubuntu 14.04 (LTS). My 2 cents. Thank you for the information.

mijamo commented 8 years ago

I don't think nodejs is installed by default on Ubuntu 14.04. At least I had to install it manually. Isn't it more like the default version installed by your server provider ? I could be wrong on that, just asking.

gaearon commented 8 years ago

I haven't tested 0.10 but I'm surprised with the output. Any chance you are behind some sort of firewall that makes npm registry requests return gibberish?

vajrasky commented 8 years ago

It is not installed by default. I installed it via apt-get. http://packages.ubuntu.com/trusty/nodejs

$ sudo apt-get install npm

I am not behind any firewall.

mijamo commented 8 years ago

Oh I see, but in Ubuntu those are the instructions to follow: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

Many things are broken with old versions of NPM and Node, this is not really normal that those versions are still installed when running apt-get install nodejs or npm.

petetnt commented 8 years ago

This is related to https://github.com/npm/npm/issues/12196 which should be fixed soon

zpao commented 8 years ago

Thanks for tracking that down @petetnt. Closing this out since it's an npm registry issue. Please subscribe to the issue linked above if you need to know when it is fully resolved.