Home > Web Front-end > Front-end Q&A > What to do if node start reports an error

What to do if node start reports an error

藏色散人
Release: 2022-12-29 13:55:04
Original
3847 people have browsed it

Node start error solution: 1. Execute "node xx.js" directly in the terminal; 2. Add the start startup item "scripts": {"test": "echo \"Error: no test specified\" && exit 1","start":"node service.js"}"; 3. Execute "npm start" again.

What to do if node start reports an error

The operating environment of this tutorial: Windows 10 system, node v7.6.0 version, Dell G3 computer.

node start What should I do if I get an error?

The node terminal executes npm start and an error "npm ERR! missing script: start" appears

Open package.json with the following content

"scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  }
Copy after login

There are two solutions.

1. Execute node xx.js directly in the terminal

xx.js is the file you want to execute

2. Add the start startup item

 "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start":"node service.js"
  }
Copy after login

Then execute npm start and it will be executed successfully

Recommended learning: "node.js video tutorial"

The above is the detailed content of What to do if node start reports an error. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template