0

у меня есть файл server.js , который запускает локальный сервер для просмотра фронтенда а я забыл какой командой его запустить

var http = require('http');
var static = require('node-static');
var file = new static.Server('.');

http.createServer(function(req, res) {
 file.serve(req, res);
}).listen(80);

console.log('Server running on port 80');

командой npm run-script server.js выдает ошибки

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run-script" "server.js"
npm ERR! node v6.10.0
npm ERR! npm  v3.10.10

npm ERR! missing script: server.js
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\User\Desktop\nano\npm-debug.log

1 ответ 1

3

Вы можете запустить его командой

node server.js
1
  • ага, спасибо, так точно
    – cache0
    26 мар 2017 в 17:31

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.