第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

運(yùn)行“npm start”時(shí)出現(xiàn)循環(huán)錯(cuò)誤?

運(yùn)行“npm start”時(shí)出現(xiàn)循環(huán)錯(cuò)誤?

侃侃爾雅 2022-05-26 16:58:45
我正在嘗試在我的計(jì)算機(jī)上本地運(yùn)行節(jié)點(diǎn)應(yīng)用程序。我npm start在命令行上運(yùn)行時(shí)收到以下錯(cuò)誤:npm ERR! code ELIFECYCLEnpm ERR! errno 1npm ERR! node-express@1.0.0 start: `node index`npm ERR! Exit status 1npm ERR! npm ERR! Failed at the node-express@1.0.0 start script.npm ERR! This is probably not a problem with npm. There is likely additional logging output above.這是我的package.json:{  "name": "node-express",  "version": "1.0.0",  "description": "Node Express Examples",  "main": "index.js",  "scripts": {    "test": "echo \"Error: no test specified\" && exit 1",    "start": "node index"  },  "author": "Shilpa Kancharla",  "license": "ISC",  "dependencies": {    "body-parser": "^1.19.0",    "morgan": "^1.10.0"  }}這是我的index.js:const express = require('express');const http = require('http');const hostname = 'localhost';const port = 3000;const app = express();const morgan = require('morgan');app.use(morgan('dev'));app.use(express.static(__dirname + '/public'));const bodyParser = require('body-parser');app.use(bodyParser.json());const dishRouter = require('./routes/dishRouter');const promoRouter = require('./require/promoRouter');const leaderRouter = require('./require/leaderRouter');app.use('/dishes', dishRouter);app.use('/promotions', promoRouter);app.use('/leaders', leaderRouter);app.use((req, res, next) => {    console.log(req.headers);    res.statusCode = 200;    res.setHeader('Content-Type', 'text/html');    res.end('<html><body><h1>This is an Express Server </h1></body></html>');});const server = http.createServer(app);server.listen(port, hostname, () => {    console.log(`Server running at http://${hostname}:${port}/`);});我嘗試安裝和卸載節(jié)點(diǎn)模塊,將其名稱更改為start,node index.js但node index沒有這樣的運(yùn)氣。
查看完整描述

1 回答

?
哈士奇WWW

TA貢獻(xiàn)1799條經(jīng)驗(yàn) 獲得超6個(gè)贊

使用這個(gè) package.json


{

  "name": "node-express",

  "version": "1.0.0",

  "description": "Node Express Examples",

  "main": "index.js",

  "scripts": {

    "test": "echo \"Error: no test specified\" && exit 1",

    "start": "nodemon index.js"

  },

  "author": "Shilpa Kancharla",

  "license": "ISC",

  "dependencies": {

    "body-parser": "^1.19.0",

    "express": "^4.17.1",

    "http": "0.0.0",

    "morgan": "^1.10.0"

  },

  "devDependencies": {

    "nodemon": "^2.0.2"

  }

}

現(xiàn)在通過運(yùn)行以下命令運(yùn)行和更新節(jié)點(diǎn)模塊


npm i or npm install

您現(xiàn)在可以通過運(yùn)行以下命令開始


npm start


查看完整回答
反對(duì) 回復(fù) 2022-05-26
  • 1 回答
  • 0 關(guān)注
  • 238 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)