jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.96k stars 513 forks source link

Cannot find module 'babel-runtime/core-js/object/keys' #2278

Closed DanielPritchard closed 8 years ago

DanielPritchard commented 8 years ago

I am getting this error after updating to version 3.0.4 (it also occurs for 3.0.5)

Error: Cannot find module 'babel-runtime/core-js/object/keys'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/danpritchard/dev/pucbroker-puchandler-lambda/node_modules/jscs/node_modules/cst/lib/Parser.js:7:13)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
markelog commented 8 years ago

You probably need to reinstall your node_modules

cscott commented 8 years ago

No, I'm getting the same thing in a clean build on travis. One of your dependencies broke w/ the jscs 3.0.5 release it seems.

cscott commented 8 years ago

This fails: https://travis-ci.org/cscott/node-libzim/jobs/139508554 This (yesterday) succeeded: https://travis-ci.org/cscott/node-libzim/jobs/139420369

Was:

jscs@3.0.5 node_modules/jscs
├── to-double-quotes@2.0.0
├── estraverse@4.2.0
├── to-single-quotes@2.0.0
├── strip-json-comments@1.0.4
├── reserved-words@0.1.1
├── natural-compare@1.2.2
├── vow@0.4.12
├── pathval@0.1.1
├── jscs-preset-wikimedia@1.0.0
├── commander@2.9.0 (graceful-readlink@1.0.1)
├── exit@0.1.2
├── xmlbuilder@3.1.0
├── strip-bom@2.0.0 (is-utf8@0.2.1)
├── chalk@1.1.3 (escape-string-regexp@1.0.5, supports-color@2.0.0, ansi-styles@2.2.1, has-ansi@2.0.0, strip-ansi@3.0.1)
├── minimatch@3.0.2 (brace-expansion@1.1.5)
├── glob@5.0.15 (path-is-absolute@1.0.0, inherits@2.0.1, once@1.3.3, inflight@1.0.5)
├── cli-table@0.3.1 (colors@1.0.3)
├── vow-fs@0.3.5 (vow-queue@0.4.2, uuid@2.0.2, glob@4.5.3)
├── resolve@1.1.7
├── jscs-jsdoc@2.0.0 (jsdoctypeparser@1.2.0, comment-parser@0.3.1)
├── htmlparser2@3.8.3 (domelementtype@1.3.0, entities@1.0.0, domhandler@2.3.0, readable-stream@1.1.14, domutils@1.5.1)
├── js-yaml@3.4.6 (inherit@2.2.3, esprima@2.7.2, argparse@1.0.7)
├── prompt@0.2.14 (revalidator@0.1.8, pkginfo@0.4.0, read@1.0.7, utile@0.2.1, winston@0.8.3)
├── jsonlint@1.6.2 (nomnom@1.8.1, JSV@4.0.2)
├── lodash@3.10.1
└── cst@0.4.0 (babylon@6.8.1, source-map-support@0.4.0, babel-types@6.10.2, babel-runtime@6.9.2)

Now is:

jscs@3.0.5 node_modules/jscs
├── to-double-quotes@2.0.0
├── estraverse@4.2.0
├── to-single-quotes@2.0.0
├── strip-json-comments@1.0.4
├── reserved-words@0.1.1
├── natural-compare@1.2.2
├── vow@0.4.12
├── pathval@0.1.1
├── jscs-preset-wikimedia@1.0.0
├── exit@0.1.2
├── commander@2.9.0 (graceful-readlink@1.0.1)
├── xmlbuilder@3.1.0
├── strip-bom@2.0.0 (is-utf8@0.2.1)
├── chalk@1.1.3 (escape-string-regexp@1.0.5, ansi-styles@2.2.1, supports-color@2.0.0, strip-ansi@3.0.1, has-ansi@2.0.0)
├── minimatch@3.0.2 (brace-expansion@1.1.5)
├── glob@5.0.15 (path-is-absolute@1.0.0, inherits@2.0.1, inflight@1.0.5, once@1.3.3)
├── cli-table@0.3.1 (colors@1.0.3)
├── vow-fs@0.3.5 (vow-queue@0.4.2, uuid@2.0.2, glob@4.5.3)
├── resolve@1.1.7
├── jscs-jsdoc@2.0.0 (jsdoctypeparser@1.2.0, comment-parser@0.3.1)
├── js-yaml@3.4.6 (inherit@2.2.3, esprima@2.7.2, argparse@1.0.7)
├── htmlparser2@3.8.3 (domelementtype@1.3.0, entities@1.0.0, domhandler@2.3.0, readable-stream@1.1.14, domutils@1.5.1)
├── prompt@0.2.14 (revalidator@0.1.8, pkginfo@0.4.0, read@1.0.7, utile@0.2.1, winston@0.8.3)
├── jsonlint@1.6.2 (nomnom@1.8.1, JSV@4.0.2)
├── lodash@3.10.1
└── cst@0.4.1 (source-map-support@0.4.0, babylon@6.8.1)

It seems to be cst@0.4.1 which kills jscs, it dropped its babel deps.

cscott commented 8 years ago

Root cause seems to be https://github.com/cst/cst/issues/111, which dropped support for node < 4.

markelog commented 8 years ago

Should be fine now

mattgrande commented 7 years ago

This reared it's head for me again today, since cst eliminated support for older versions of node again in v0.4.8 (and I'm still on Node 0.10.33...)

For anyone else coming here, I got around this by creating an npm-shrinkwrap.json file, and setting the cst version to 0.4.7:

{
  "dependencies": {
    "jscs": {
      "version": "3.0.7",
      "from": "jscs@3.0.7",
      "dependencies": {
        "cst": {
          "version": "0.4.7",
          "from": "cst@^0.4.3"
        }
      }
    }
  }
}

(If you've never used shrinkwrap before, I recommend reading here: https://docs.npmjs.com/cli/shrinkwrap)

hzoo commented 7 years ago

@mattgrande it didn't remove support yet - the package didn't publish a lib directory so there were no files https://github.com/cst/cst/issues/151

mattgrande commented 7 years ago

Oh! I just assumed it was the same issue, should've checked cst to be sure.

Looks like they've released 0.4.9, so this is no longer needed!