Après application du tutoriel suggéré, voici ce que j'obtiens
Code : Tout sélectionner
pi@raspberrypi:~/node-sonos-http-api $ npm install
added 265 packages from 290 contributors and audited 470 packages in 55.795s
found 1 low severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
Ensuite, je démarre le server.js et j'ai ceci
Code : Tout sélectionner
pi@raspberrypi:~/node-sonos-http-api $ node server.js
2018-11-27T17:46:04.425Z INFO Could not find file /home/pi/node-sonos-http-api/settings.json
2018-11-27T17:46:04.734Z INFO Presets loaded: { example:
{ players:
[ { roomName: 'Bathroom', volume: 10 },
{ roomName: 'Kitchen', volume: 10 },
{ roomName: 'Office', volume: 10 },
{ roomName: 'Bedroom', volume: 10 },
{ roomName: 'TV Room', volume: 15 } ],
playMode: { shuffle: true, repeat: 'all', crossfade: false },
pauseOthers: false } }
2018-11-27T17:46:07.520Z INFO http server listening on 0.0.0.0 port 5005
J'ai suivi par l'installation de pm2 et j'obtiens ceci
Code : Tout sélectionner
pi@raspberrypi:~/node-sonos-http-api $ sudo npm install pm2 -g
/usr/bin/pm2 -> /usr/lib/node_modules/pm2/bin/pm2
/usr/bin/pm2-dev -> /usr/lib/node_modules/pm2/bin/pm2-dev
/usr/bin/pm2-docker -> /usr/lib/node_modules/pm2/bin/pm2-docker
/usr/bin/pm2-runtime -> /usr/lib/node_modules/pm2/bin/pm2-runtime
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/pm2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
+ pm2@3.2.2
added 313 packages from 243 contributors in 67.646s
J'ai ensuite tenter de démarrer le service avec pm2 mais j'ai une erreur
Code : Tout sélectionner
pi@raspberrypi:~/node-sonos-http-api $ node server.js
2018-11-27T18:06:25.295Z INFO Could not find file /home/pi/node-sonos-http-api/settings.json
2018-11-27T18:06:25.599Z INFO Presets loaded: { example:
{ players:
[ { roomName: 'Bathroom', volume: 10 },
{ roomName: 'Kitchen', volume: 10 },
{ roomName: 'Office', volume: 10 },
{ roomName: 'Bedroom', volume: 10 },
{ roomName: 'TV Room', volume: 15 } ],
playMode: { shuffle: true, repeat: 'all', crossfade: false },
pauseOthers: false } }
2018-11-27T18:06:28.314Z INFO http server listening on 0.0.0.0 port 5005
(node:21353) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
^C
pi@raspberrypi:~/node-sonos-http-api $ pm2 -x start server.js --name "node-sonos"
[PM2] Starting /home/pi/node-sonos-http-api/server.js in fork_mode (1 instance)
[PM2] Done.
┌────────────┬────┬─────────┬──────┬───────┬────────┬─────────┬────────┬─────┬───────────┬──────┬──────────┐
│ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
├────────────┼────┼─────────┼──────┼───────┼────────┼─────────┼────────┼─────┼───────────┼──────┼──────────┤
│ node-sonos │ 0 │ 1.6.5 │ fork │ 21506 │ online │ 0 │ 0s │ 0% │ 25.1 MB │ pi │ disabled │
└────────────┴────┴─────────┴──────┴───────┴────────┴─────────┴────────┴─────┴───────────┴──────┴──────────┘
Use `pm2 show <id|name>` to get more details about an app
Bref, un grand merci pour le coup de main
SI je peux encore abusé un peu, l'erreur suivante me turlupine...
Code : Tout sélectionner
018-11-27T18:06:25.295Z INFO Could not find file /home/pi/node-sonos-http-api/settings.json
2018-11-27T18:06:25.599Z INFO Presets loaded: { example:
{ players:
[ { roomName: 'Bathroom', volume: 10 },
{ roomName: 'Kitchen', volume: 10 },
{ roomName: 'Office', volume: 10 },
{ roomName: 'Bedroom', volume: 10 },
{ roomName: 'TV Room', volume: 15 } ],
playMode: { shuffle: true, repeat: 'all', crossfade: false },
pauseOthers: false } }
Une idée de la cause/résolution?
Merci beaucoup