Closed SylvainGa closed 4 years ago
Describe the bug When I try to install room assistant on a raspberrypi zero w with the command sudo npm i --global --unsafe-perm room-assistant
I get the following output: npm ERR! Unexpected end of JSON input while parsing near '...t":"^2.4.2","undersco'
npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2020-04-16T23_17_42_587Z-debug.log
Log is empty (ie, no new lines)
To reproduce The command wget -O - https://raw.githubusercontent.com/sdesalas/node-pi-zero/master/install-node-v.lts.sh | bash also failed because it tried to download node-v10.20.0-linux-armv6l.tar.gz but the file present is node-v10.20.1-linux-armv6l.tar.gz. I had to manually run the commands in the bash script.
Then when I try to install it through the command above, it gives that error on screen
Relevant logs Log output that correlates to the bug. You can get debug output with room-assistant -v.
room-assistant -v
1 verbose cli [ '/opt/nodejs/bin/node', 1 verbose cli '/usr/local/bin/npm', 1 verbose cli 'i', 1 verbose cli '--global', 1 verbose cli '--unsafe-perm', 1 verbose cli 'room-assistant' ] 2 info using npm@6.14.4 3 info using node@v10.20.1 4 verbose npm-session 5004ca9f7ef99fc2 5 silly install loadCurrentTree 6 silly install readGlobalPackageData 7 http fetch GET 200 https://registry.npmjs.org/room-assistant 3027ms 8 http fetch GET 200 https://registry.npmjs.org/room-assistant/-/room-assistant-2.4.0.tgz 1117ms 9 silly pacote tag manifest for room-assistant@latest fetched in 4517ms 10 timing stage:loadCurrentTree Completed in 5042ms 11 silly install loadIdealTree 12 silly install cloneCurrentTreeToIdealTree 13 timing stage:loadIdealTree:cloneCurrentTree Completed in 7ms 14 silly install loadShrinkwrap 15 timing stage:loadIdealTree:loadShrinkwrap Completed in 34ms 16 silly install loadAllDepsIntoIdealTree 17 silly resolveWithNewModule room-assistant@2.4.0 checking installable status 18 http fetch GET 200 https://registry.npmjs.org/command-line-args 1830ms 19 http fetch GET 200 https://registry.npmjs.org/command-line-usage 1937ms 20 http fetch GET 200 https://registry.npmjs.org/@nestjs%2fcommon 2459ms 21 http fetch GET 200 https://registry.npmjs.org/@nestjs%2fplatform-express 4906ms 22 http fetch GET 200 https://registry.npmjs.org/@nestjs%2fschedule 4911ms 23 http fetch GET 200 https://registry.npmjs.org/async-mqtt 4934ms 24 http fetch GET 200 https://registry.npmjs.org/command-line-args/-/command-line-args-5.1.1.tgz 2903ms 25 http fetch GET 200 https://registry.npmjs.org/democracy 4780ms 26 http fetch GET 200 https://registry.npmjs.org/github-sponsors 4758ms 27 http fetch GET 200 https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.0.tgz 2668ms 28 http fetch GET 200 https://registry.npmjs.org/@nestjs%2fcore 5394ms 29 http fetch GET 200 https://registry.npmjs.org/@nestjs/common/-/common-6.11.11.tgz 2448ms 30 silly pacote range manifest for command-line-args@^5.1.1 fetched in 6759ms 31 silly resolveWithNewModule command-line-args@5.1.1 checking installable status 32 silly pacote range manifest for command-line-usage@^6.1.0 fetched in 6773ms 33 silly resolveWithNewModule command-line-usage@6.1.0 checking installable status 34 silly pacote range manifest for @nestjs/common@^6.7.2 fetched in 7257ms 35 silly resolveWithNewModule @nestjs/common@6.11.11 checking installable status 36 http fetch GET 200 https://registry.npmjs.org/async-mqtt/-/async-mqtt-2.5.0.tgz 2032ms 37 http fetch GET 200 https://registry.npmjs.org/democracy/-/democracy-3.1.3.tgz 2015ms 38 http fetch GET 200 https://registry.npmjs.org/github-sponsors/-/github-sponsors-1.0.1.tgz 2002ms 39 http fetch GET 200 https://registry.npmjs.org/@nestjs/schedule/-/schedule-0.1.1.tgz 2226ms 40 http fetch GET 200 https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-6.11.11.tgz 2312ms 41 http fetch GET 200 https://registry.npmjs.org/@nestjs/core/-/core-6.11.11.tgz 1813ms 42 silly pacote range manifest for async-mqtt@^2.4.2 fetched in 7594ms 43 silly resolveWithNewModule async-mqtt@2.5.0 checking installable status 44 silly pacote range manifest for democracy@^3.1.3 fetched in 7426ms 45 silly pacote range manifest for github-sponsors@^1.0.1 fetched in 7404ms 46 silly resolveWithNewModule democracy@3.1.3 checking installable status 47 silly resolveWithNewModule github-sponsors@1.0.1 checking installable status 48 silly pacote range manifest for @nestjs/schedule@^0.1.1 fetched in 7810ms 49 silly pacote range manifest for @nestjs/platform-express@^6.10.14 fetched in 7968ms 50 silly resolveWithNewModule @nestjs/schedule@0.1.1 checking installable status 51 silly resolveWithNewModule @nestjs/platform-express@6.11.11 checking installable status 52 http fetch GET 200 https://registry.npmjs.org/js-yaml 966ms 53 silly pacote range manifest for @nestjs/core@^6.7.2 fetched in 8279ms 54 silly resolveWithNewModule @nestjs/core@6.11.11 checking installable status 55 http fetch GET 200 https://registry.npmjs.org/lodash 1329ms 56 http fetch GET 200 https://registry.npmjs.org/kalmanjs 1926ms 57 http fetch GET 200 https://registry.npmjs.org/reflect-metadata 3393ms 58 http fetch GET 200 https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz 3392ms 59 http fetch GET 200 https://registry.npmjs.org/nest-winston 3765ms 60 http fetch GET 200 https://registry.npmjs.org/nest-emitter 3827ms 61 http fetch GET 200 https://registry.npmjs.org/mathjs 3899ms 62 http fetch GET 200 https://registry.npmjs.org/node-pre-gyp 4236ms 63 http fetch GET 200 https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz 9835ms 64 http fetch GET 200 https://registry.npmjs.org/kalmanjs/-/kalmanjs-1.1.0.tgz 9788ms 65 http fetch GET 200 https://registry.npmjs.org/rimraf 10617ms 66 silly pacote range manifest for js-yaml@^3.13.1 fetched in 11930ms 67 silly resolveWithNewModule js-yaml@3.13.1 checking installable status 68 http fetch GET 200 https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz 7508ms 69 http fetch GET 200 https://registry.npmjs.org/nest-winston/-/nest-winston-1.3.3.tgz 7178ms 70 http fetch GET 200 https://registry.npmjs.org/nest-emitter/-/nest-emitter-1.1.0.tgz 7040ms 71 http fetch GET 200 https://registry.npmjs.org/mathjs/-/mathjs-6.6.4.tgz 7029ms 72 http fetch GET 200 https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz 6713ms 73 silly pacote range manifest for lodash@^4.17.15 fetched in 12251ms 74 silly resolveWithNewModule lodash@4.17.15 checking installable status 75 silly pacote range manifest for kalmanjs@^1.1.0 fetched in 12440ms 76 silly resolveWithNewModule kalmanjs@1.1.0 checking installable status 77 silly pacote range manifest for reflect-metadata@^0.1.13 fetched in 12000ms 78 silly resolveWithNewModule reflect-metadata@0.1.13 checking installable status 79 silly pacote range manifest for nest-winston@^1.3.3 fetched in 12307ms 80 silly resolveWithNewModule nest-winston@1.3.3 checking installable status 81 silly pacote range manifest for nest-emitter@^1.1.0 fetched in 12605ms 82 silly pacote range manifest for mathjs@^6.5.0 fetched in 12675ms 83 silly resolveWithNewModule nest-emitter@1.1.0 checking installable status 84 silly resolveWithNewModule mathjs@6.6.4 checking installable status 85 silly pacote range manifest for node-pre-gyp@^0.14.0 fetched in 12661ms 86 silly resolveWithNewModule node-pre-gyp@0.14.0 checking installable status 87 http fetch GET 200 https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz 1830ms 88 http fetch GET 200 https://registry.npmjs.org/systeminformation 1304ms 89 http fetch GET 200 https://registry.npmjs.org/slugify 1430ms 90 silly pacote range manifest for rimraf@^3.0.0 fetched in 13065ms 91 silly resolveWithNewModule rimraf@3.0.2 checking installable status 92 http fetch GET 200 https://registry.npmjs.org/winston 1194ms 93 http fetch GET 200 https://registry.npmjs.org/mdns 1160ms 94 http fetch GET 200 https://registry.npmjs.org/i2c-bus 1260ms 95 http fetch GET 200 https://registry.npmjs.org/onoff 2887ms 96 http fetch GET 200 https://registry.npmjs.org/rxjs 4641ms 97 http fetch GET 200 https://registry.npmjs.org/slugify/-/slugify-1.4.0.tgz 2440ms 98 http fetch GET 200 https://registry.npmjs.org/@abandonware%2fnoble 3736ms 99 http fetch GET 200 https://registry.npmjs.org/winston/-/winston-3.2.1.tgz 6611ms 100 http fetch GET 200 https://registry.npmjs.org/systeminformation/-/systeminformation-4.23.3.tgz 6904ms 101 http fetch GET 200 https://registry.npmjs.org/mdns/-/mdns-2.5.1.tgz 6382ms 102 http fetch GET 200 https://registry.npmjs.org/i2c-bus/-/i2c-bus-5.1.0.tgz 6227ms 103 silly pacote range manifest for slugify@^1.3.6 fetched in 8730ms 104 silly resolveWithNewModule slugify@1.4.0 checking installable status 105 http fetch GET 200 https://registry.npmjs.org/onoff/-/onoff-5.0.1.tgz 4367ms 106 http fetch GET 200 https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz 4342ms 107 silly pacote range manifest for winston@^3.2.1 fetched in 8232ms 108 silly pacote range manifest for mdns@^2.5.1 fetched in 7846ms 109 silly resolveWithNewModule winston@3.2.1 checking installable status 110 silly resolveWithNewModule mdns@2.5.1 checking installable status 111 silly pacote range manifest for systeminformation@^4.19.1 fetched in 8811ms 112 silly resolveWithNewModule systeminformation@4.23.3 checking installable status 113 silly pacote range manifest for i2c-bus@^5.1.0 fetched in 7895ms 114 silly resolveWithNewModule i2c-bus@5.1.0 checking installable status 115 silly pacote range manifest for onoff@^5.0.1 fetched in 7732ms 116 silly pacote range manifest for rxjs@^6.5.3 fetched in 9484ms 117 silly resolveWithNewModule onoff@5.0.1 checking installable status 118 silly resolveWithNewModule rxjs@6.5.5 checking installable status 119 http fetch GET 200 https://registry.npmjs.org/@abandonware/noble/-/noble-1.9.2-8.tgz 1548ms 120 silly pacote range manifest for @abandonware/noble@^1.9.2-5 fetched in 9245ms 121 silly resolveWithNewModule @abandonware/noble@1.9.2-8 checking installable status 122 silly fetchPackageMetaData error for config@^3.2.4 Response timeout while trying to fetch https://registry.npmjs.org/config (over 30000ms) 123 timing stage:rollbackFailedOptional Completed in 32ms 124 timing stage:runTopLevelLifecycles Completed in 36959ms 125 verbose type body-timeout 126 verbose stack FetchError: Response timeout while trying to fetch https://registry.npmjs.org/config (over 30000ms) 126 verbose stack at Timeout.setTimeout [as _onTimeout] (/opt/nodejs/lib/node_modules/npm/node_modules/node-fetch-npm/src/body.js:189:16) 126 verbose stack at ontimeout (timers.js:436:11) 126 verbose stack at tryOnTimeout (timers.js:300:5) 126 verbose stack at listOnTimeout (timers.js:263:5) 126 verbose stack at Timer.processTimers (timers.js:223:10) 127 verbose cwd /home/pi 128 verbose Linux 4.19.97+ 129 verbose argv "/opt/nodejs/bin/node" "/usr/local/bin/npm" "i" "--global" "--unsafe-perm" "room-assistant" 130 verbose node v10.20.1 131 verbose npm v6.14.4 132 error Response timeout while trying to fetch https://registry.npmjs.org/config (over 30000ms) 133 verbose exit [ 1, true ]
Relevant configuration Paste the relevant parts of your configuration below.
Expected behavior A clear and concise description of what you expected to happen.
Environment
Additional context Add any other context about the problem here.
Nothing much more I can add.
Thanks.
I ran
sudo npm cache clean --force
and my issue is gone.
fixed with me
nvm install v12.13.1 nvm alias defualt v12.13.1 npm cache clean --force npm install
Describe the bug When I try to install room assistant on a raspberrypi zero w with the command sudo npm i --global --unsafe-perm room-assistant
I get the following output: npm ERR! Unexpected end of JSON input while parsing near '...t":"^2.4.2","undersco'
npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2020-04-16T23_17_42_587Z-debug.log
Log is empty (ie, no new lines)
To reproduce The command wget -O - https://raw.githubusercontent.com/sdesalas/node-pi-zero/master/install-node-v.lts.sh | bash also failed because it tried to download node-v10.20.0-linux-armv6l.tar.gz but the file present is node-v10.20.1-linux-armv6l.tar.gz. I had to manually run the commands in the bash script.
Then when I try to install it through the command above, it gives that error on screen
Relevant logs Log output that correlates to the bug. You can get debug output with
room-assistant -v
.Relevant configuration Paste the relevant parts of your configuration below.
Expected behavior A clear and concise description of what you expected to happen.
Environment
Additional context Add any other context about the problem here.
Nothing much more I can add.
Thanks.