Я изучаю Node.js, и во вводном курсе мне пришлось настроить узел и npm. Теперь, по словам инструктора, после ввода «npm start» в терминале и внесения изменений в файл index. html браузер должен автоматически обновлять sh вкладку, чтобы изменения вступили в силу, но в моем случае каждый раз, когда я вношу изменение, мне приходилось вручную обновлять sh вкладку Safari, чтобы увидеть изменения.
Обратите внимание, что я использую один и тот же компьютер, т.е. нет сервера и клиента как таковых . Операционная система - macOS Catalina 10.15.6.
Возможные исправления, пожалуйста?
Спасибо
Структура файла: введите описание изображения здесь
пакет. json файл:
{
"name": "confusion",
"version": "1.0.0",
"description": "This is a website for Ristorante Con Fusion",
"main": "index.html",
"scripts": {
"start": "npm run lite",
"test": "echo \"Error: no test specified\" && exit 1",
"lite": "lite-server"
},
"author": "Raffay",
"license": "ISC",
"devDependencies": {
"lite-server": "^2.5.4"
},
"dependencies": {
"bootstrap": "^4.5.0",
"jquery": "^3.5.1",
"nodemon": "^2.0.4",
"popper.js": "^1.16.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/RaffaySajjad/conFusion.git"
},
"keywords": [
"conFusion"
],
"bugs": {
"url": "https://github.com/RaffaySajjad/conFusion/issues"
},
"homepage": "https://github.com/RaffaySajjad/conFusion#readme"
}
Запуск nodemon с терминала с помощью команды «nodemon» выводит следующую ошибку
raffaysajjad@192 ~ % cd /Users/raffaysajjad/Desktop/Full\ Stack\ Web\ Development\ \(React\ Specialization\)/Course\ 1\ \(Front-End\ WebUI\ Frameworks\ \&\ Tools\ -\ Bootstrap\ 4\)/Week\ 1/Exercise/conFusion
raffaysajjad@192 conFusion % nodemon
[nodemon] 2.0.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: html,json
[nodemon] starting `node index.html`
/Users/raffaysajjad/Desktop/Full Stack Web Development (React Specialization)/Course 1 (Front-End WebUI Frameworks & Tools - Bootstrap 4)/Week 1/Exercise/conFusion/index.html:1
<!DOCTYPE html>
^
SyntaxError: Unexpected token '<'
at wrapSafe (internal/modules/cjs/loader.js:1053:16)
at Module._compile (internal/modules/cjs/loader.js:1101:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
[nodemon] app crashed - waiting for file changes before starting...