Home>

App created with vue.js
I want to build a local environment

Error message
cosmiconfig requires at least version 4 of Node, please upgrade
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Applicable source code
PS C: \ git>yarn run dev
yarn run v1.19.2
$node build/dev-server.js
>Starting dev server ...
cosmiconfig requires at least version 4 of Node, please upgrade
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I wondered if I should update thecosmiconfig Yara nodethat had been in an easy error
The command I tried is below

yarn upgrade cosmiconfig
 yarn upgrade node
Supplemental information (FW/tool version etc.)
Version confirmation
PS C: \ git>npm -v
6.13.2
PS C: \ git>node -v
v13.3.0
PS C: \ git>
package.json
{
  "name": "hoge",
  "version": "1.0.0",
  "description": "for hoge",
  "author": "hoge",
  "private": true,
  "scripts": {
    "dev": "node build/dev-server.js",
    "start": "node build/dev-server.js",
    "build": "node build/build.js",
    "stage": "node build/build.js stage",
    "unit": "cross-env BABEL_ENV = test karma start test/unit/karma.conf.js --single-run",
    "e2e": "node test/e2e/runner.js",
    "test": "npm run unit&&npm run e2e"
  },
  "dependencies": {
    "axios": "^ 0.16.2",
    "bootstrap": "^ 3.3.7",
    "cd-themify-icons": "^ 0.0.1",
    "es6-promise-promise": "^ 1.0.0",
    "moment": "^ 2.22.1",
    "object-path": "^ 0.11.4",
    "vue": "^ 2.4.2",
    "vue-analytics": "^ 5.16.0",
    "vue-form-wizard": "^ 0.7.0",
    "vue-i18n": "^ 7.6.0",
    "vue-moment": "^ 3.2.0",
    "vue-multiselect": "^ 2.1.0",
    "vuejs-datatable": "^ 1.5.3",
    "vuex": "^ 2.4.0"
  },
  "devDependencies": {
    "autoprefixer": "^ 7.1.2",
    "axios": "^ 0.17.0",
    "babel-core": "^ 6.22.1",
    "babel-loader": "^ 7.1.1",
    "babel-plugin-istanbul": "^ 4.1.1",
    "babel-plugin-transform-runtime": "^ 6.22.0",
    "babel-preset-env": "^ 1.3.2",
    "babel-preset-stage-2": "^ 6.22.0",
    "babel-register": "^ 6.22.0",
    "chai": "^ 3.5.0",
    "chalk": "^ 2.0.1",
    "chromedriver": "^ 2.27.2",
    "connect-history-api-fallback": "^ 1.3.0",
    "copy-webpack-plugin": "^ 4.0.1",
    "cross-env": "^ 5.0.1",
    "cross-spawn": "^ 5.0.1",
    "css-loader": "^ 0.28.0",
    "cssnano": "^ 3.10.0",
    "eventsource-polyfill": "^ 0.9.6",
    "express": "^ 4.14.1",
    "extract-text-webpack-plugin": "^ 2.0.0",
    "file-loader": "^ 0.11.1",
    "friendly-errors-webpack-plugin": "^ 1.1.3",
    "html-webpack-plugin": "^ 2.28.0",
    "http-proxy-middleware": "^ 0.17.3",
    "inject-loader": "^ 3.0.0",
    "karma": "^ 1.4.1",
    "karma-coverage": "^ 1.1.1",
    "karma-mocha": "^ 1.3.0",
    "karma-phantomjs-launcher": "^ 1.0.2",
    "karma-phantomjs-shim": "^ 1.4.0",
    "karma-sinon-chai": "^ 1.3.1",
    "karma-sourcemap-loader": "^ 0.3.7",
    "karma-spec-reporter": "0.0.31",
    "karma-webpack": "^ 2.0.2",
    "mocha": "^ 3.2.0",
    "nightwatch": "^ 0.9.12",
    "opn": "^ 5.1.0",
    "optimize-css-assets-webpack-plugin": "^ 2.0.0",
    "ora": "^ 1.2.0",
    "phantomjs-prebuilt": "^ 2.1.14",
    "rimraf": "^ 2.6.0",
    "selenium-server": "^ 3.0.1",
    "semver": "^ 5.3.0",
    "shelljs": "^ 0.7.6",
    "sinon": "^ 2.1.0",
    "sinon-chai": "^ 2.8.0",
    "url-loader": "^ 0.5.8",
    "vue-i18n": "~ 7.6.0",
    "vue-loader": "^ 13.0.4",
    "vue-router": "^ 2.8.1",
    "vue-style-loader": "^ 3.0.1",
    "vue-template-compiler": "^ 2.4.2",
    "webpack": "^ 2.6.1",
    "webpack-bundle-analyzer": "^ 2.2.1",
    "webpack-dev-middleware": "^ 1.10.0",
    "webpack-hot-middleware": "^ 2.18.0",
    "webpack-merge": "^ 4.1.0"
  },
  "engines": {
    "node": ">= 4.0.0",
    "npm": ">= 3.0.0"
  },
  "browserslist": [
    ">1%",
    "last 2 versions",
    "not ie<= 8"
  ]
}

Please provide more detailed information here.

  • Answer # 1

    package-lock.json
    yarn.lock
    cosmiconfig
      version "2.1.0" →
      version "6.0.0"


    It was able to start by re-execution specifying.

    PS C: \ git \>yarn run dev yarn run v1.19.2
    $node build/dev-server.js
    >Starting dev server ...
    {parser: "babylon"} is deprecated;we now treat it as {parser: "babel"}.
     DONE Compiled successfully in 3363ms 17:44:32
    >Listening at http: // localhost: 8080