Home>


I'm trying to make a SPA using Vue.js.

〇 I am in trouble
While investigating
You need to run npm run dev. I found it from a site like that.

But I'm sorry for the error when I do this.

The error is
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev:'webpack --mode development'
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script
npm ERR! This is probably not a problem with npm.There is likely additonal logging output above.
npm ERR! A complete log of this run can be found in:
is.

〇 What I investigated
When I checked with ELIFECYCLE, there were many ways to solve it by erasing the Node.js module once and installing it again.
(The command is the same)
I tried them too, but it doesn't change at all.

The command is
① rm -rf node_modules (Since rm was not recognized by my PC, I deleted it with del)
② rm package-lock.json yarn.lock
③ npm cache clear --force
④ npm install

So far, it works fine, but when I do npm run dev, I get the same error.

Please give me advice.

* * * Addition * * *
Running npm run serve works fine.
However, in order to create an app with SPA function using vue-router
I feel like I've read something that needs to be run with npm run dev, so I'm sticking to it.

※※※

I will also post the json file at this stage.

{
  "name": "vue-project",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "webpack --mode development",
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "core-js": "^ 3.6.5",
    "vue": "^ 2.6.11"
  },
  "devDependencies": {
    "@ vue/cli-plugin-babel": "~ 4.5.0",
    "@ vue/cli-plugin-eslint": "~ 4.5.0",
    "@ vue/cli-service": "~ 4.5.0",
    "babel-eslint": "^ 10.1.0",
    "eslint": "^ 6.7.2",
    "eslint-plugin-vue": "^ 6.2.2",
    "vue-template-compiler": "^ 2.6.11"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin: vue/essential",
      "eslint: recommended"
    ],,
    "parserOptions": {
      "parser": "babel-eslint"
    },
    "rules": {}
  },
  "browserslist": [
    ">1%",
    "last 2 versions",
    "not dead"
  ]
}

* * Addition * *
I changed the description of the json file where dev is written, but the result is the same.

"dev": "vue-cli-service dev",

※※※