简体   繁体   中英

Can´t start the server created from the express.js generator

I am trying to setup a express.js server using there generator. I have followed the documation and I have succesfully created the basic structure. However if I try to run the given command ( SET DEBUG=transcriptverificationserver:* & npm start ) to start the server I always get the following error:

npm ERR! Missing script: "start"
npm ERR!
npm ERR! Did you mean one of these?
npm ERR!     npm stars # View packages marked as favorites
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\a\AppData\Local\npm-cache\_logs\2022-11-28T22_43_43_285Z-debug-0.log
PS C:\Users\a\Desktop\Verified Transcripts\Webpage> npm start
npm ERR! Missing script: "start"
npm ERR!
npm ERR! Did you mean one of these?
npm ERR!     npm star # Mark your favorite packages
npm ERR!     npm stars # View packages marked as favorites
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\a\AppData\Local\npm-cache\_logs\2022-11-28T22_45_41_209Z-debug-0.log

I assume its an issue within the package.json file. The script part looks as following:

  "scripts": {
    "start": "node ./bin/www"
  },

I haven´t change anything in the files or structure and I was simply copying the commands from the documentation ( https://expressjs.com/en/starter/generator.html ) Thanks for any help in advance

I have tried it again and this time everthing works. I am not sure what has happend before but I might have used the old installation method.

$ npm install -g express-generator
$ express

With my secound try I ensured to use the new method:

$ npx express-generator

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM