Пытаюсь запустить дев сервер командой npm run start:dev
. Выдает ошибку, что в заголовке. Код всех файлов привожу.
package.json
{
"name": "nodejs",
"version": "1.0.0",
"description": "",
"main": "src/index.js",
"engines": {
"node": "15.3.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node src/index.js",
"start:dev": "nodemon",
"clean": "rimraf build && mkdirp build",
"build-babel": "babel -d ./build ./src -s --copy-files",
"build": "npm run clean && npm run build-babel",
"postinstall": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://git@gitlab.com:mh_koval/nodejs.git"
},
"author": "Mykhayl Koval <mykhaylkoval@gmail.com>",
"license": "ISC",
"bugs": {
"url": "https://git@gitlab.com:mh_koval/nodejs/issues"
},
"homepage": "https://git@gitlab.com:mh_koval/nodejs#readme",
"devDependencies": {
"@babel/cli": "^7.10.3",
"@babel/core": "^7.10.3",
"@babel/node": "^7.10.3",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.10.3",
"babel-loader": "^8.1.0",
"mkdirp": "^0.5.5",
"nodemon": "^2.0.4",
"rimraf": "^3.0.2"
},
"dependencies": {
"express": "^4.17.1"
}
}
nodemon.json
{
"watch": [
"src",
".env"
],
"ext": "js, json",
"ignore": [
"src/**/*.spec.ts"
],
"exec": "babel-node ./src/index.js"
}
.babelrc
{
"presets": [
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-proposal-class-properties"
],
"ignore": []
}
Структура
Ошибка
npm install
.