Npm run dev crashes randomly

Hi everyone,

first of all: thanks for this great piece of software. Unfortunately and out of the blue I’m facing an issue that makes it nearly impossible to work with it locally.

Running npm run dev compiles everything nicely and then it’s waiting for changes as it’s supposed to do. Upon saving a file it compiles again but randomly aborts the whole script with the following error message:

Assertion failed: (napi_create_string_utf8(env, events->events[idx].path, NAPI_AUTO_LENGTH, &args[0]) == napi_ok),
function fse_dispatch_event, file ../src/fsevents.c, line 147.

Versions

  • nuxt: 2.14.12
  • node: 14.15.4
  • npm: 6.14.11
  • OS: MacOS 10.14.6

Reproduction

I guess it’s hard to reproduce as even here npm run dev aborts not every time I’m saving a file. I’ve added my dependencies from package.json here:

{
  "name": "my-project",
  "version": "1.0.1",
  "private": true,
  "repository": {
    "type": "git",
    "url": "my-repo.com"
  },
  "auto-changelog": {
    "commitUrl": "my-url.com"
  },
  "scripts": {
    "dev": "nuxt-ts",
    "build": "nuxt-ts build",
    "start": "nuxt-ts start",
    "generate": "nuxt-ts generate",
    "lint:js": "eslint --ext .js,.vue --ignore-path .gitignore .",
    "lint": "npm run lint:js",
    "test": "jest",
    "version": "auto-changelog --commit-limit false -p && git add CHANGELOG.md"
  },
  "dependencies": {
    "@fortawesome/fontawesome-free": "^5.15.1",
    "@nuxt/content": "^1.11.1",
    "@nuxt/typescript-runtime": "^1.0.0",
    "@nuxtjs/axios": "^5.12.5",
    "bootstrap": "^4.5.3",
    "bootstrap-vue": "^2.21.2",
    "cookie-universal-nuxt": "^2.1.4",
    "nuxt": "^2.14.12",
    "nuxt-typed-vuex": "^0.1.22",
    "video.js": "^7.10.2"
  },
  "devDependencies": {
    "@nuxt/types": "^2.14.12",
    "@nuxt/typescript-build": "^2.0.3",
    "@nuxtjs/eslint-config": "^3.1.0",
    "@nuxtjs/eslint-config-typescript": "^3.0.0",
    "@nuxtjs/eslint-module": "^2.0.0",
    "@types/video.js": "^7.3.11",
    "@types/webpack": "^4.41.26",
    "@types/webpack-env": "^1.16.0",
    "@vue/test-utils": "^1.1.2",
    "auto-changelog": "^2.2.0",
    "babel-core": "7.0.0-bridge.0",
    "babel-eslint": "^10.1.0",
    "babel-jest": "^26.6.3",
    "eslint": "^7.17.0",
    "eslint-plugin-nuxt": "^1.0.0",
    "fsevents": "^2.3.1",
    "jest": "^26.6.3",
    "node-sass": "^4.14.1",
    "sass-loader": "^9.0.3",
    "ts-jest": "^26.4.4",
    "vue-jest": "^3.0.7"
  }
}

What is Expected?

npm run dev compiles again upon saving a file.

What is actually happening?

npm run dev randomly aborts compilation. Upon some file savings it works, then it aborts again.

2 thoughts on “Npm run dev crashes randomly

  1. I’ve got the same problem, except that it fails in run dev mode on any change in the underlying code.
    Assertion failed: (napi_create_string_utf8(env, events->events[idx].path, NAPI_AUTO_LENGTH, &args[0]) == napi_ok), function fse_dispatch_event, file ../src/fsevents.c, line 147.
    error Command failed with signal “SIGABRT”.

  2. I had the same issue and ended up downgrading to fsevents@2.1.0.
    In order to do so, I switched from npm to yarn and added a resolutions entry in the package.json that instructs yarn to install this particular version throughout the dependency tree:

    "resolutions": {
      "**/fsevents": "2.1.0"
    }