Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module '@babel/runtime/helpers/interopRequireDefault' #1738

Closed
arniu opened this issue May 23, 2020 · 6 comments
Closed

Error: Cannot find module '@babel/runtime/helpers/interopRequireDefault' #1738

arniu opened this issue May 23, 2020 · 6 comments
Labels
bug

Comments

@arniu
Copy link

@arniu arniu commented May 23, 2020

Expected Behavior

Current Behavior

Preparing...
Running tasks...
Applying modifications...
husky > commit-msg (node v12.16.1)
internal/modules/cjs/loader.js:985
throw err;
^

Error: Cannot find module '@babel/runtime/helpers/interopRequireDefault'
Require stack:

  • /Users/<path/to/project>/node_modules/@commitlint/cli/lib/cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object. (/Users/<path/to/project>/node_modules/@commitlint/cli/lib/cli.js:4:30)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/Users/<path/to/project>/node_modules/@commitlint/cli/lib/cli.js'
    ]
    }
    husky > commit-msg hook failed (add --no-verify to bypass)

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Steps to Reproduce (for bugs)

  1. First step
  2. Second step
commitlint.config.js ```js ```

Context

Your Environment

Executable Version
commitlint --version 9.0.0
git --version 2.24.3 (Apple Git-128)
node --version v12.16.1
@escapedcat
Copy link
Collaborator

@escapedcat escapedcat commented May 24, 2020

Can you post you package.json? Thanks

Where does this output come from?:

✔ Preparing...
✔ Running tasks...
✔ Applying modifications...
@arniu
Copy link
Author

@arniu arniu commented May 24, 2020

{
  "name": "root",
  "private": true,
  "version": "1.0.0",
  "workspaces": {
    "packages": [
      "packages/*",
      "app"
    ],
    "nohoist": [
      "app/**"
    ]
  },
  "scripts": {
    "ios": "yarn workspace app ios",
    "android": "yarn workspace app android",
    "clean": "rimraf {app,packages}/**/node_modules",
    "lint": "yarn workspaces run lint",
    "test": "yarn workspaces run test"
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged",
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
      "pre-push": "yarn lint && yarn test"
    }
  },
  "lint-staged": {
    "*.{md,js,jsx,tsx,ts}": [
      "npx prettier --write"
    ]
  },
  "prettier": {
    "trailingComma": "all",
    "singleQuote": true,
    "semi": true
  },
  "devDependencies": {
    "@commitlint/cli": "^9.x",
    "@commitlint/config-conventional": "^9.x",
    "@types/jest": "^25.x",
    "@types/node": "^14.x",
    "husky": "^4.x",
    "jest": "^26.x",
    "lint-staged": "^10.x",
    "prettier": "^2.x",
    "rimraf": "^3.x",
    "ts-jest": "^26.x",
    "ts-node": "^8.x",
    "typescript": "^3.8"
  }
}
@escapedcat
Copy link
Collaborator

@escapedcat escapedcat commented May 24, 2020

Please post your commitlint.config.js.
Where is the config located? In the root of the project?

@arniu
Copy link
Author

@arniu arniu commented May 24, 2020

module.exports = {
  extends: ['@commitlint/config-conventional'],
};

Yes, it's in the root, beside the previous package.json.

@escapedcat
Copy link
Collaborator

@escapedcat escapedcat commented May 24, 2020

Thanks. That helped. It's bug in v9.0.0 I guess. Please use @latest for now and see if that works for you:
npm i -D @commitlint/config-conventional@latest @commitlint/cli@latest
This should install:

├─ @commitlint/cli@8.3.5
└─ @commitlint/config-conventional@8.3.4
@escapedcat escapedcat added the bug label May 24, 2020
escapedcat added a commit that referenced this issue May 24, 2020
@escapedcat escapedcat mentioned this issue May 24, 2020
2 of 7 tasks complete
escapedcat added a commit that referenced this issue May 24, 2020
escapedcat added a commit that referenced this issue May 24, 2020
@arniu
Copy link
Author

@arniu arniu commented May 24, 2020

Thanks~

@arniu arniu closed this May 24, 2020
escapedcat added a commit that referenced this issue May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.