Upgrade to Pro — share decks privately, control downloads, hide ads and more …

中華製npmのCNPMがある模様 #iotlt

32fc21c821f829e470225311c7530832?s=47 n0bisuke
December 15, 2020

中華製npmのCNPMがある模様 #iotlt

IoTLT vol70での発表です。 CNPMってあるんですねぇ〜
https://iotlt.connpass.com/event/196360
インストール怖いので自己責任でお願いします。

32fc21c821f829e470225311c7530832?s=128

n0bisuke

December 15, 2020
Tweet

Transcript

  1. *P5-5WPM த՚੡OQNͷ$/1.͕͋Δ໛༷ OCJTVLF ΈΜͳ஌ͬͯͨʁ

  2. ੁݪͷͼ͚͢ dotstudio, Inc. ɾEPUTUVEJPגࣜձࣾ ๏ਓ޲͚*P5ݚमϓϩτλΠϐϯάݚमͳͲ ϓϩτλΠϐϯάઐ໳εΫʔϧʮϓϩτΞ΢τελδΦʯߍ௕ ɾݸਓ׆ಈ ೔ຊ࠷େͷ*P5ίϛϡχςΟʮ*P5-5ʯओ࠵ .JDSPTPGU.71 -*/&"1*&YQFSU

    OPCJTVLFTVHBXBSB
  3. ϓϩτλΠϐϯάઐ໳εΫʔϧʮϓϩτΞ΢τελδΦʯ  ϓϩάϥϛϯάΑΓ΋"1*΍πʔϧΛ࢖͍͜ͳٕ͢ज़ΛֶͿ  ϓϩτλΠϐϯά͚ͩͰऴΘΒͤͣΞ΢τϓοτ͢Δ·Ͱ  ଔۀ੍࡞͸$".1'*3&ͰΫϥ΢υϑΝϯσΟϯά࣮ࢪ  ՝୊Λݟ͚ͭͯࣗ෼Ͱ࣮૷͠ɺൃ৴Ͱ͖ΔਓࡐΛҭ͍ͯͯΔ ϓϩτΞ΢τελδΦ

  4. OQN ɾ/PEF1BDLBHF.BOBHFS ɾ/PEFKTʹඥ࡞͘ύοέʔδϚωʔδϟʔͱύοέʔδͷϨδετϦ ɾ/PEFKTͰͳΜͪΌΒ͢Δͱ͖ʹ΄΅ඞਢͰར༻ ɾ*P5͢Δͱ͖΋ར༻͢Δγʔϯ͸ଟ͍ ɾ/PEF3&%΋ཪͰ͜Ε΍ͬͯΔ ɾ৭ʑͳύοέʔδϚωʔδϟʔ QJQ OVHFU FUD

    ͷதͰ࠷ଟΒ͍͠
  5. DOQN ɾத՚൛ͷOQN ɾ ڪΒ͘ ۚ६ʹΑͬͯΞΫηεग़དྷͳ͍ύοέʔδΛ࢖͍͍ͨ΍ͭ ɾ࢖͍উख͸OQNͱಉ༷ ɾOQNܦ༝ͰΠϯετʔϧ ɾதࠃʹߦͬͨ࣌ͷ։ൃͰ࢖͑ͦ͏

  6. DOQN ɾத՚൛ͷOQN ɾ ڪΒ͘ ۚ६ʹΑͬͯΞΫηεग़དྷͳ͍ύοέʔδΛ࢖͍͍ͨ΍ͭ ɾ࢖͍উख͸OQNͱಉ༷ ɾOQNܦ༝ͰΠϯετʔϧ ɾதࠃʹߦͬͨ࣌ͷ։ൃͰ࢖͑ͦ͏ ɾউखͳҹ৅Ͱ͕͢৘ใൈ͔Εͦ͏ͰΠϯετʔϧ͕গ͠ා͍

  7. DOQN͕OQNʹ΋͍Δͱ͍͏ϝλͳঢ়گ

  8. ͳ͔ͥ 5BPCBP͕ϨδετϦΛ࣋ͬͯΔ IUUQTEFWFMPQFSBMJZVODPNNJSSPS/1. GSPNUOQN ɾ5BPCBPʹϨδετϦ͞Ε͍ͯΔ ɾ5BPCBPதࠃͷΦϯϥΠϯϞʔϧ ɾ 5BPCBPͬͯ"84తͳಈ͖ͯ͠ΔΜͰ͔͢Ͷʁ

  9. DOQN࢖ͬͯΈͨ

  10. DOQN࢖ͬͯΈͨ OQNJHDOQN

  11. DOQN࢖ͬͯΈͨ OQNJHDOQN ˞OQNܦ༝ͰΠϯετʔϧҎ֎ʹ΋௚઀%-΋ग़དྷΔ໛༷

  12. ͱΓ͋͑ͣΠϯετʔϧ͕஗͍ OQNJHDOQN OQN8"3/EFQSFDBUFESFRVFTU!SFRVFTUIBTCFFOEFQSFDBUFE T IUUQTHJUIVCDPNSFRVFTUSFRVFTUJTTVFT OQN8"3/EFQSFDBUFEIBSWBMJEBUPS!UIJTMJCSBSZJTOPMPOHFS TVQQPSUFE 6TFSTOCJTVLFOPEFCSFXOPEFWCJODOQN6TFST OCJTVLFOPEFCSFXOPEFWMJCOPEF@NPEVMFTDOQNCJODOQN DOQN!

    BEEFEQBDLBHFTGSPNDPOUSJCVUPSTJOT
  13. ͱΓ͋͑ͣΠϯετʔϧ͕஗͍ OQNJHDOQN OQN8"3/EFQSFDBUFESFRVFTU!SFRVFTUIBTCFFOEFQSFDBUFE T IUUQTHJUIVCDPNSFRVFTUSFRVFTUJTTVFT OQN8"3/EFQSFDBUFEIBSWBMJEBUPS!UIJTMJCSBSZJTOPMPOHFS TVQQPSUFE 6TFSTOCJTVLFOPEFCSFXOPEFWCJODOQN6TFST OCJTVLFOPEFCSFXOPEFWMJCOPEF@NPEVMFTDOQNCJODOQN DOQN!

    BEEFEQBDLBHFTGSPNDPOUSJCVUPSTJOT ෼ڧ
  14. ࢀߟZBSO OQNJHZBSO ZBSO!QSFJOTUBMM6TFSTOCJTVLFOPEFCSFXOPEFWMJC OPEF@NPEVMFTZBSO  OPEFQSFJOTUBMMKTEFWOVMMccUSVF  6TFSTOCJTVLFOPEFCSFXOPEFWCJOZBSOQLH6TFST OCJTVLFOPEFCSFXOPEFWMJCOPEF@NPEVMFTZBSOCJOZBSOKT 6TFSTOCJTVLFOPEFCSFXOPEFWCJOZBSO6TFST

    OCJTVLFOPEFCSFXOPEFWMJCOPEF@NPEVMFTZBSOCJOZBSOKT ZBSO! VQEBUFEQBDLBHFJOT ඵ
  15. DOQN࢖ͬͯΈͨ DOQNW ˞DOQNͷ࠷৽ܥɺOQNͷ࠷৽ܥͰ͕࣌ؒࠩ͋Γͦ͏

  16. DOQN࢖ͬͯΈͨ DOQNW

  17. DOQN࢖ͬͯΈͨ DOQNJOJUZ

  18. JOJUͷࡍͷQBDLBHFKTPO͸ಉ͡ { "name": "test-cnpm", "version": "1.0.0", "description": "", "main": "index.js",

    "scripts": { "test": "echo \"Error: no test specified\" && exit }, "keywords": [], "author": "", "license": "ISC", "dependencies": { } } { "name": "test-cnpm", "version": "1.0.0", "description": "", "main": “index.js", "dependencies": { }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC" }
  19. OQY DOQYNRUUTVCUUFTUIMPDBMIPTU

  20. OQY͸·ͩͳͦ͞͏ DOQYNRUUTVCUUFTUIMPDBMIPTU ˞DPNNBOEOPUGPVOEDOQY

  21. .255νϟϨϯδ JPUMUͳͷͰ

  22. OQNJOTUBMMNRUU DOQYNRUUTVCUUFTUIMPDBMIPTU

  23. OQNJOTUBMMNRUU DOQNJNRUU ͱΓ͋͑ͣΊͪΌ஗ͯ͘λΠϜΞ΢τ

  24. DOQNTFUUJNFPVUͰ্ݶ৳͹͢ DOQNTFUUJNFPVU Cnpm install error: Connect timeout for 5000ms stepping

    on the pi t IUUQTXXXQSPHSBNNFSTPVHIUDPNBSUJDMF ຊՈnpm ʹ͋Δ….? ͳ͍͔΋ (ௐ΂͖Εͯͳ͍)
  25. ͪͳΈʹDOQNݶఆػೳ΋͍͔ͭ͘ DOQNTZOD DOQNJCZOQNSFBDUOBUJWF DOQNDIFDL

  26. OQNJOTUBMMNRUU DOQYNRUUTVCUUFTUIMPDBMIPTU ͱΓ͋͑ͣΊͪΌ஗ͯ͘λΠϜΞ΢τ

  27. OQNJOTUBMMNRUU DOQNJNRUU λΠϜΞ΢τઃఆͨ͠Β͏·͍͖͘·ͨ͠ɻ

  28. OQNŠNRUUŠDOQN ໰୊ͳ͘ૄ௨ OQYNRUUTVCIUFTUNPTRVJUUPPSHUOCJTVLF )FMMPDOQN const mqtt = require('mqtt'); const client

    = mqtt.connect('mqtt://test.mosquitto.org'); client.on('connect', () => { client.publish('n0bisuke', 'Hello cnpm'); });
  29. #-&νϟϨϯδ

  30. ࣌ؒ੾Ε

  31. ࣌ؒ੾Ε DOQNJOPCMF ৭ʑΤϥʔͰ͚ͨͲ ௨ৗOQNͰ΋ಉͬ͡Ά͍

  32. ·ͱΊ ɾDOQN͕͋Δʂ ɾதࠃʹ͍ͬͯOQN࢖͏ͱ͖ʹྑ͍͔΋ ɾதࠃʹ͍ͯ71/ͳ͠ͷ؀ڥͰ(PPHMFܥͷԿ͔Λ࢖͍͍ͨ ͱ͖ͱ͔ͳͷ͔ͳ ɾ೔ຊʹ͍Δ෼ʹ͸஗͍͚ͩͳͷͰɺಛʹ࢖͏ඞཁແ͠ ɾωλͱͯ͠஌ͬͯΔͱ໘ന͍͔΋  ͜ͷωλͰ2JJUBهࣄͩ͢ͷͰݟͯͶ