Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
ejecutando node.js usando systemd pero systemd no pudo encontrar html

Usando raspberry pi4, express para el servidor, obtenga datos a través de socket.io y envíe los datos al lado del cliente (html) e inicie sesión en la API de descanso.

El problema es que systemd no pudo encontrar el archivo html. Cuando ejecuto $ sudo systemctl start FileToServer.service HTML me muestra este mensaje de error.

 Error: ENOENT: no such file or directory, stat '/index.html'
  1. $ node server.js está funcionando. y puedo ver lo que quiero y no hay ningún mensaje de error.
  2. sudo systemctl start FileToServer.service también puede ejecutar server.js
  3. sudo systemctl status FileToServer.service y confirmé que activo está activo (en ejecución).
  4. También ejecuto usando $ sudo su y no funcionó

Que puedo hacer ?

 [Unit] Description=usb lte [Service] Type=simple ExecStart=/usr/bin/node /home/pi/Desktop/rpi4_clientside/server.js Restart=on-failure #User=pi #User=root #Group=root [Install] WantedBy=multi-user.target

Este es el fragmento de código que estoy luchando. servidor.js

 import express from "express"; const app = express(); import { SerialPort } from "serialport"; import { ReadlineParser } from "@serialport/parser-readline"; import { createServer } from "http"; import { Server } from "socket.io"; const httpServer = createServer(app); const io = new Server(httpServer, {}); import axios from "axios"; import path from 'path'; const __dirname = path.resolve(); const PORTnum = 3000; const publicIp = "222.33.222.33" const localIp = "172.3.1.2" const serverSidePort = "5500" let api_url = `http://${publicIp}:${serverSidePort}/gps`; httpServer.listen(PORTnum, () => { console.log(`it's alive on http://localhost:${PORTnum}`); }) app.use(express.json()) app.get("/", (req, res) => { // console.log(res); res.sendFile(__dirname + "/index.html"); });
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!