I can't start the project on a local server

I took over a colleague’s project and I can’t start the project on a local server.

Indeed, I did use the "npm install" command to install the "node_modules" folder.

Then, I try to execute the "dev" script in the "package.json" file in my terminal but without success.

I have the following errors:

hermannmanuel@ps4-ea63b4 bartimus-frontend % npm run dev


> bartimus-frontend@1.0.0 dev /Users/hermannmanuel/Documents/Cyber-Resilience/bartimus-frontend
> cross-env BABEL_ENV=development webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

events.js:291
      throw er; // Unhandled 'error' event
      ^

Error: spawn webpack-dev-server ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
    at onErrorNT (internal/child_process.js:468:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
    at onErrorNT (internal/child_process.js:468:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn webpack-dev-server',
  path: 'webpack-dev-server',
  spawnargs: [ '--inline', '--progress', '--config', 'build/webpack.dev.conf.js' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bartimus-frontend@1.0.0 dev: `cross-env BABEL_ENV=development webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the bartimus-frontend@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/hermannmanuel/.npm/_logs/2021-01-28T18_43_42_881Z-debug.log

Do you know where the problem might come from?

This is a project with Vue.

I’m using version 6.14.10 of NPM.

I am using version v14.8.0 of Node.

I am using a MacBook Pro with the version macOS Big Sur 11.0.1.

Thank you in advance for your help.


Edit: Here is my package.json:

{
  "name": "bartimus-frontend",
  "version": "1.0.0",
  "description": "Frontend for Bartimus application",
  "author": "Samuel Darcey <sdarcey@cyber-resilience.net>",
  "license": "ISC",
  "repository": {
    "type": "git",
    "url": "https://gitlab.cyber-resilience.net/it-team/bartimus-frontend.git"
  },
  "bugs": {
    "url": "https://gitlab.cyber-resilience.net/it-team/bartimus-frontend/issues"
  },
  "homepage": "https://gitlab.cyber-resilience.net/it-team/bartimus-frontend",
  "engines": {
    "npm": ">=6.9.0",
    "node": ">=10.16.0"
  },
  "scripts": {
    "dev": "cross-env BABEL_ENV=development webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
    "build:prod": "cross-env NODE_ENV=production env_config=prod node build/build.js",
    "build:alpha": "cross-env NODE_ENV=alpha env_config=alpha node build/build.js",
    "lint": "eslint --ext .js,.vue src",
    "test": "npm run lint",
    "precommit": "lint-staged",
    "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
  },
  "lint-staged": {
    "src/**/*.{js,vue}": [
      "eslint --fix",
      "git add"
    ]
  },
  "keywords": [
    "vue",
    "element-ui",
    "bartimus",
    "frontend"
  ],
  "dependencies": {
    "axios": "^0.18.0",
    "clipboard": "^1.7.1",
    "codemirror": "^5.39.2",
    "cyre-constants-lib": "^1.0.0-alpha.8",
    "driver.js": "^0.8.1",
    "dropzone": "^5.2.0",
    "echarts": "^4.1.0",
    "element-ui": "^2.4.11",
    "file-saver": "^1.3.8",
    "fuse.js": "^3.4.2",
    "interval-promise": "^1.3.0",
    "js-cookie": "^2.2.0",
    "jsonlint": "^1.6.3",
    "jszip": "^3.1.5",
    "lodash.startcase": "^4.4.0",
    "mockjs": "^1.0.1-beta3",
    "moment": "^2.24.0",
    "normalize.css": "^7.0.0",
    "nprogress": "^0.2.0",
    "password-validator": "^5.0.2",
    "screenfull": "^4.0.0",
    "showdown": "^1.8.6",
    "sortablejs": "^1.7.0",
    "tiptap": "^1.24.1",
    "tiptap-extensions": "^1.26.1",
    "tui-editor": "^1.2.7",
    "vue": "^2.6.12",
    "vue-clipboard2": "^0.3.0",
    "vue-count-to": "^1.0.13",
    "vue-data-tables": "^3.4.4",
    "vue-i18n": "^7.3.2",
    "vue-js-modal": "^1.3.31",
    "vue-router": "^3.0.2",
    "vue-spinner": "^1.0.3",
    "vue-splitpane": "^1.0.2",
    "vue-tables-2": "^1.4.70",
    "vue-underscore": "^0.1.4",
    "vuedraggable": "^2.16.0",
    "vuex": "^3.0.1",
    "xlsx": "^0.11.16"
  },
  "devDependencies": {
    "autoprefixer": "^8.5.0",
    "babel-core": "^6.26.3",
    "babel-eslint": "^10.0.2",
    "babel-helper-vue-jsx-merge-props": "^2.0.3",
    "babel-loader": "^7.1.5",
    "babel-plugin-dynamic-import-node": "^2.0.0",
    "babel-plugin-syntax-jsx": "^6.18.0",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-plugin-transform-vue-jsx": "^3.7.0",
    "babel-preset-env": "^1.7.0",
    "babel-preset-stage-2": "^6.24.1",
    "chalk": "^2.4.1",
    "compression-webpack-plugin": "^2.0.0",
    "connect": "^3.6.6",
    "copy-webpack-plugin": "^4.5.2",
    "cross-env": "^5.2.1",
    "css-loader": "^1.0.0",
    "eslint": "^6.0.1",
    "eslint-friendly-formatter": "^4.0.1",
    "eslint-loader": "^2.1.2",
    "eslint-plugin-vue": "^5.2.2",
    "file-loader": "^1.1.11",
    "friendly-errors-webpack-plugin": "^1.7.0",
    "hash-sum": "^1.0.2",
    "html-webpack-plugin": "^4.0.0-alpha",
    "husky": "^0.14.3",
    "lint-staged": "^9.1.0",
    "mini-css-extract-plugin": "^0.4.1",
    "node-notifier": "^5.2.1",
    "node-sass": "^4.7.2",
    "optimize-css-assets-webpack-plugin": "^5.0.0",
    "ora": "^3.0.0",
    "path-to-regexp": "^2.4.0",
    "portfinder": "^1.0.13",
    "postcss-import": "^11.1.0",
    "postcss-loader": "^2.1.6",
    "postcss-url": "^7.3.2",
    "readme-md-generator": "^0.2.1",
    "rimraf": "^2.6.2",
    "sass-loader": "^7.0.3",
    "script-ext-html-webpack-plugin": "^2.0.1",
    "script-loader": "^0.7.2",
    "semver": "^5.5.0",
    "serve-static": "^1.13.2",
    "shelljs": "^0.8.2",
    "svg-sprite-loader": "^3.8.0",
    "svgo": "^1.2.0",
    "uglifyjs-webpack-plugin": "^1.2.7",
    "url-loader": "^1.0.1",
    "vue-loader": "^15.3.0",
    "vue-style-loader": "^4.1.2",
    "vue-template-compiler": "^2.5.17",
    "webpack": "^4.46.0",
    "webpack-bundle-analyzer": "^3.3.2",
    "webpack-cli": "^3.1.0",
    "webpack-dev-server": "^3.1.14",
    "webpack-merge": "^4.1.4"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ]
}

13 thoughts on “I can't start the project on a local server”

  1. I would be really, really thankful if someone can help me with this.

    Here is my package.json:

    {
      "name": "bartimus-frontend",
      "version": "1.0.0",
      "description": "Frontend for Bartimus application",
      "author": "Samuel Darcey <sdarcey@cyber-resilience.net>",
      "license": "ISC",
      "repository": {
        "type": "git",
        "url": "https://gitlab.cyber-resilience.net/it-team/bartimus-frontend.git"
      },
      "bugs": {
        "url": "https://gitlab.cyber-resilience.net/it-team/bartimus-frontend/issues"
      },
      "homepage": "https://gitlab.cyber-resilience.net/it-team/bartimus-frontend",
      "engines": {
        "npm": ">=6.9.0",
        "node": ">=10.16.0"
      },
      "scripts": {
        "dev": "cross-env BABEL_ENV=development webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
        "build:prod": "cross-env NODE_ENV=production env_config=prod node build/build.js",
        "build:alpha": "cross-env NODE_ENV=alpha env_config=alpha node build/build.js",
        "lint": "eslint --ext .js,.vue src",
        "test": "npm run lint",
        "precommit": "lint-staged",
        "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
      },
      "lint-staged": {
        "src/**/*.{js,vue}": [
          "eslint --fix",
          "git add"
        ]
      },
      "keywords": [
        "vue",
        "element-ui",
        "bartimus",
        "frontend"
      ],
      "dependencies": {
        "axios": "^0.18.0",
        "clipboard": "^1.7.1",
        "codemirror": "^5.39.2",
        "cyre-constants-lib": "^1.0.0-alpha.8",
        "driver.js": "^0.8.1",
        "dropzone": "^5.2.0",
        "echarts": "^4.1.0",
        "element-ui": "^2.4.11",
        "file-saver": "^1.3.8",
        "fuse.js": "^3.4.2",
        "interval-promise": "^1.3.0",
        "js-cookie": "^2.2.0",
        "jsonlint": "^1.6.3",
        "jszip": "^3.1.5",
        "lodash.startcase": "^4.4.0",
        "mockjs": "^1.0.1-beta3",
        "moment": "^2.24.0",
        "normalize.css": "^7.0.0",
        "nprogress": "^0.2.0",
        "password-validator": "^5.0.2",
        "screenfull": "^4.0.0",
        "showdown": "^1.8.6",
        "sortablejs": "^1.7.0",
        "tiptap": "^1.24.1",
        "tiptap-extensions": "^1.26.1",
        "tui-editor": "^1.2.7",
        "vue": "^2.6.12",
        "vue-clipboard2": "^0.3.0",
        "vue-count-to": "^1.0.13",
        "vue-data-tables": "^3.4.4",
        "vue-i18n": "^7.3.2",
        "vue-js-modal": "^1.3.31",
        "vue-router": "^3.0.2",
        "vue-spinner": "^1.0.3",
        "vue-splitpane": "^1.0.2",
        "vue-tables-2": "^1.4.70",
        "vue-underscore": "^0.1.4",
        "vuedraggable": "^2.16.0",
        "vuex": "^3.0.1",
        "xlsx": "^0.11.16"
      },
      "devDependencies": {
        "autoprefixer": "^8.5.0",
        "babel-core": "^6.26.3",
        "babel-eslint": "^10.0.2",
        "babel-helper-vue-jsx-merge-props": "^2.0.3",
        "babel-loader": "^7.1.5",
        "babel-plugin-dynamic-import-node": "^2.0.0",
        "babel-plugin-syntax-jsx": "^6.18.0",
        "babel-plugin-transform-runtime": "^6.23.0",
        "babel-plugin-transform-vue-jsx": "^3.7.0",
        "babel-preset-env": "^1.7.0",
        "babel-preset-stage-2": "^6.24.1",
        "chalk": "^2.4.1",
        "compression-webpack-plugin": "^2.0.0",
        "connect": "^3.6.6",
        "copy-webpack-plugin": "^4.5.2",
        "cross-env": "^5.2.1",
        "css-loader": "^1.0.0",
        "eslint": "^6.0.1",
        "eslint-friendly-formatter": "^4.0.1",
        "eslint-loader": "^2.1.2",
        "eslint-plugin-vue": "^5.2.2",
        "file-loader": "^1.1.11",
        "friendly-errors-webpack-plugin": "^1.7.0",
        "hash-sum": "^1.0.2",
        "html-webpack-plugin": "^4.0.0-alpha",
        "husky": "^0.14.3",
        "lint-staged": "^9.1.0",
        "mini-css-extract-plugin": "^0.4.1",
        "node-notifier": "^5.2.1",
        "node-sass": "^4.7.2",
        "optimize-css-assets-webpack-plugin": "^5.0.0",
        "ora": "^3.0.0",
        "path-to-regexp": "^2.4.0",
        "portfinder": "^1.0.13",
        "postcss-import": "^11.1.0",
        "postcss-loader": "^2.1.6",
        "postcss-url": "^7.3.2",
        "readme-md-generator": "^0.2.1",
        "rimraf": "^2.6.2",
        "sass-loader": "^7.0.3",
        "script-ext-html-webpack-plugin": "^2.0.1",
        "script-loader": "^0.7.2",
        "semver": "^5.5.0",
        "serve-static": "^1.13.2",
        "shelljs": "^0.8.2",
        "svg-sprite-loader": "^3.8.0",
        "svgo": "^1.2.0",
        "uglifyjs-webpack-plugin": "^1.2.7",
        "url-loader": "^1.0.1",
        "vue-loader": "^15.3.0",
        "vue-style-loader": "^4.1.2",
        "vue-template-compiler": "^2.5.17",
        "webpack": "^4.46.0",
        "webpack-bundle-analyzer": "^3.3.2",
        "webpack-cli": "^3.1.0",
        "webpack-dev-server": "^3.1.14",
        "webpack-merge": "^4.1.4"
      },
      "browserslist": [
        "> 1%",
        "last 2 versions",
        "not ie <= 8"
      ]
    }
    
    Reply

Leave a Comment