Missing babel-runtime
Opened this issue · 6 comments
NPM: 4.6.1
Yarn: 0.21.3
Node: 7.10.0
Koa: 2.2.0
Koa-Webpack: 0.5.1
module.js:472
throw err;
^
Error: Cannot find module 'babel-runtime/core-js/object/assign'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\jerom\Documents\GitHub\koa-angular\node_modules\koa-webpack\dist\index.js:7:15)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\jerom\Documents\GitHub\koa-angular\index.js:14:17)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
Solved this issue with npm install babel-runtime --save-dev
/ yarn add babel-runtime -D
.
Without any additional context, I can't comment on what might not have worked for you. I can state without question however, that there isn't an error within the module itself.
computer: ~
→ /github/koa-webpack
computer: /github/koa-webpack [git:master]
→ rm -rf node_modules
computer: /github/koa-webpack [git:master]
→ npm install && npm test
Tests ran successfully with a fresh npm install. Gonna chalk this one up to an error on your system. Please reopen if you find something more systemic, perhaps an issue with Windows.
steps i did with a clean repo (eg no modules installled)
npm install koa-webpack webpack --save-dev
require koa-webpack in my index.js and try to run it with node index.js
and then i'm getting the error.
λ node index.js
module.js:472
throw err;
^
Error: Cannot find module 'babel-runtime/core-js/object/assign'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\jerom\Documents\GitHub\web\node_modules\koa-webpack\dist\index.js:7:15)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
npm install log
λ npm install koa-webpack webpack
web@1.0.0 C:\Users\jerom\Documents\GitHub\web
+-- koa-webpack@0.5.1
| +-- app-root-path@2.0.1
| +-- koa-compose@4.0.0
| +-- webpack@2.2.1
| | +-- acorn@4.0.13
| | +-- acorn-dynamic-import@2.0.2 deduped
| | +-- ajv@4.11.8 deduped
| | +-- ajv-keywords@1.5.1 deduped
| | +-- async@2.4.1 deduped
| | +-- enhanced-resolve@3.1.0 deduped
| | +-- interpret@1.0.3 deduped
| | +-- json-loader@0.5.4 deduped
| | +-- loader-runner@2.3.0 deduped
| | +-- loader-utils@0.2.17 deduped
| | +-- memory-fs@0.4.1 deduped
| | +-- mkdirp@0.5.1 deduped
| | +-- node-libs-browser@2.0.0 deduped
| | +-- source-map@0.5.6 deduped
| | +-- supports-color@3.2.3 deduped
| | +-- tapable@0.2.6 deduped
| | +-- uglify-js@2.8.27 deduped
| | +-- watchpack@1.3.1 deduped
| | +-- webpack-sources@0.1.5
| | | +-- source-list-map@0.1.8
| | | `-- source-map@0.5.6 deduped
| | `-- yargs@6.6.0 deduped
| +-- webpack-dev-middleware@1.10.2
| | +-- memory-fs@0.4.1 deduped
| | +-- mime@1.3.6
| | +-- path-is-absolute@1.0.1
| | `-- range-parser@1.2.0
| `-- webpack-hot-middleware@2.18.0
| +-- ansi-html@0.0.7
| +-- html-entities@1.2.1
| +-- querystring@0.2.0
| `-- strip-ansi@3.0.1
| `-- ansi-regex@2.1.1
`-- webpack@2.6.1
+-- acorn@5.0.3
+-- acorn-dynamic-import@2.0.2
| `-- acorn@4.0.13 deduped
+-- ajv@4.11.8
| +-- co@4.6.0
| `-- json-stable-stringify@1.0.1
| `-- jsonify@0.0.0
+-- ajv-keywords@1.5.1
+-- async@2.4.1
| `-- lodash@4.17.4
+-- enhanced-resolve@3.1.0
| +-- graceful-fs@4.1.11
| +-- memory-fs@0.4.1 deduped
| +-- object-assign@4.1.1
| `-- tapable@0.2.6 deduped
+-- interpret@1.0.3
+-- json-loader@0.5.4
+-- json5@0.5.1
+-- loader-runner@2.3.0
+-- loader-utils@0.2.17
| +-- big.js@3.1.3
| +-- emojis-list@2.1.0
| +-- json5@0.5.1 deduped
| `-- object-assign@4.1.1 deduped
+-- memory-fs@0.4.1
| +-- errno@0.1.4
| | `-- prr@0.0.0
| `-- readable-stream@2.2.10
| +-- core-util-is@1.0.2
| +-- inherits@2.0.3
| +-- isarray@1.0.0
| +-- process-nextick-args@1.0.7
| +-- safe-buffer@5.0.1
| +-- string_decoder@1.0.1
| | `-- safe-buffer@5.0.1 deduped
| `-- util-deprecate@1.0.2
+-- mkdirp@0.5.1
| `-- minimist@0.0.8
+-- node-libs-browser@2.0.0
| +-- assert@1.4.1
| | `-- util@0.10.3 deduped
| +-- browserify-zlib@0.1.4
| | `-- pako@0.2.9
| +-- buffer@4.9.1
| | +-- base64-js@1.2.0
| | +-- ieee754@1.1.8
| | `-- isarray@1.0.0 deduped
| +-- console-browserify@1.1.0
| | `-- date-now@0.1.4
| +-- constants-browserify@1.0.0
| +-- crypto-browserify@3.11.0
| | +-- browserify-cipher@1.0.0
| | | +-- browserify-aes@1.0.6
| | | | +-- buffer-xor@1.0.3
| | | | +-- cipher-base@1.0.3 deduped
| | | | +-- create-hash@1.1.3 deduped
| | | | +-- evp_bytestokey@1.0.0 deduped
| | | | `-- inherits@2.0.3 deduped
| | | +-- browserify-des@1.0.0
| | | | +-- cipher-base@1.0.3 deduped
| | | | +-- des.js@1.0.0
| | | | | +-- inherits@2.0.3 deduped
| | | | | `-- minimalistic-assert@1.0.0 deduped
| | | | `-- inherits@2.0.3 deduped
| | | `-- evp_bytestokey@1.0.0
| | | `-- create-hash@1.1.3 deduped
| | +-- browserify-sign@4.0.4
| | | +-- bn.js@4.11.6
| | | +-- browserify-rsa@4.0.1
| | | | +-- bn.js@4.11.6 deduped
| | | | `-- randombytes@2.0.4 deduped
| | | +-- create-hash@1.1.3 deduped
| | | +-- create-hmac@1.1.6 deduped
| | | +-- elliptic@6.4.0
| | | | +-- bn.js@4.11.6 deduped
| | | | +-- brorand@1.1.0
| | | | +-- hash.js@1.0.3
| | | | | `-- inherits@2.0.3 deduped
| | | | +-- hmac-drbg@1.0.1
| | | | | +-- hash.js@1.0.3 deduped
| | | | | +-- minimalistic-assert@1.0.0 deduped
| | | | | `-- minimalistic-crypto-utils@1.0.1 deduped
| | | | +-- inherits@2.0.3 deduped
| | | | +-- minimalistic-assert@1.0.0
| | | | `-- minimalistic-crypto-utils@1.0.1
| | | +-- inherits@2.0.3 deduped
| | | `-- parse-asn1@5.1.0
| | | +-- asn1.js@4.9.1
| | | | +-- bn.js@4.11.6 deduped
| | | | +-- inherits@2.0.3 deduped
| | | | `-- minimalistic-assert@1.0.0 deduped
| | | +-- browserify-aes@1.0.6 deduped
| | | +-- create-hash@1.1.3 deduped
| | | +-- evp_bytestokey@1.0.0 deduped
| | | `-- pbkdf2@3.0.12 deduped
| | +-- create-ecdh@4.0.0
| | | +-- bn.js@4.11.6 deduped
| | | `-- elliptic@6.4.0 deduped
| | +-- create-hash@1.1.3
| | | +-- cipher-base@1.0.3
| | | | `-- inherits@2.0.3 deduped
| | | +-- inherits@2.0.3 deduped
| | | +-- ripemd160@2.0.1
| | | | +-- hash-base@2.0.2
| | | | | `-- inherits@2.0.3 deduped
| | | | `-- inherits@2.0.3 deduped
| | | `-- sha.js@2.4.8
| | | `-- inherits@2.0.3 deduped
| | +-- create-hmac@1.1.6
| | | +-- cipher-base@1.0.3 deduped
| | | +-- create-hash@1.1.3 deduped
| | | +-- inherits@2.0.3 deduped
| | | +-- ripemd160@2.0.1 deduped
| | | +-- safe-buffer@5.0.1 deduped
| | | `-- sha.js@2.4.8 deduped
| | +-- diffie-hellman@5.0.2
| | | +-- bn.js@4.11.6 deduped
| | | +-- miller-rabin@4.0.0
| | | | +-- bn.js@4.11.6 deduped
| | | | `-- brorand@1.1.0 deduped
| | | `-- randombytes@2.0.4 deduped
| | +-- inherits@2.0.3 deduped
| | +-- pbkdf2@3.0.12
| | | +-- create-hash@1.1.3 deduped
| | | +-- create-hmac@1.1.6 deduped
| | | +-- ripemd160@2.0.1 deduped
| | | +-- safe-buffer@5.0.1 deduped
| | | `-- sha.js@2.4.8 deduped
| | +-- public-encrypt@4.0.0
| | | +-- bn.js@4.11.6 deduped
| | | +-- browserify-rsa@4.0.1 deduped
| | | +-- create-hash@1.1.3 deduped
| | | +-- parse-asn1@5.1.0 deduped
| | | `-- randombytes@2.0.4 deduped
| | `-- randombytes@2.0.4
| | `-- safe-buffer@5.0.1 deduped
| +-- domain-browser@1.1.7
| +-- events@1.1.1
| +-- https-browserify@0.0.1
| +-- os-browserify@0.2.1
| +-- path-browserify@0.0.0
| +-- process@0.11.10
| +-- punycode@1.4.1
| +-- querystring-es3@0.2.1
| +-- readable-stream@2.2.10 deduped
| +-- stream-browserify@2.0.1
| | +-- inherits@2.0.3 deduped
| | `-- readable-stream@2.2.10 deduped
| +-- stream-http@2.7.1
| | +-- builtin-status-codes@3.0.0
| | +-- inherits@2.0.3 deduped
| | +-- readable-stream@2.2.10 deduped
| | +-- to-arraybuffer@1.0.1
| | `-- xtend@4.0.1
| +-- string_decoder@0.10.31
| +-- timers-browserify@2.0.2
| | `-- setimmediate@1.0.5
| +-- tty-browserify@0.0.0
| +-- url@0.11.0
| | +-- punycode@1.3.2
| | `-- querystring@0.2.0 deduped
| +-- util@0.10.3
| | `-- inherits@2.0.1
| `-- vm-browserify@0.0.4
| `-- indexof@0.0.1
+-- source-map@0.5.6
+-- supports-color@3.2.3
| `-- has-flag@1.0.0
+-- tapable@0.2.6
+-- uglify-js@2.8.27
| +-- source-map@0.5.6 deduped
| +-- uglify-to-browserify@1.0.2
| `-- yargs@3.10.0
| +-- camelcase@1.2.1
| +-- cliui@2.1.0
| | +-- center-align@0.1.3
| | | +-- align-text@0.1.4
| | | | +-- kind-of@3.2.2 deduped
| | | | +-- longest@1.0.1
| | | | `-- repeat-string@1.6.1
| | | `-- lazy-cache@1.0.4
| | +-- right-align@0.1.3
| | | `-- align-text@0.1.4 deduped
| | `-- wordwrap@0.0.2
| +-- decamelize@1.2.0 deduped
| `-- window-size@0.1.0
+-- watchpack@1.3.1
| +-- async@2.4.1 deduped
| +-- chokidar@1.7.0
| | +-- anymatch@1.3.0
| | | +-- arrify@1.0.1
| | | `-- micromatch@2.3.11
| | | +-- arr-diff@2.0.0
| | | | `-- arr-flatten@1.0.3
| | | +-- array-unique@0.2.1
| | | +-- braces@1.8.5
| | | | +-- expand-range@1.8.2
| | | | | `-- fill-range@2.2.3
| | | | | +-- is-number@2.1.0
| | | | | | `-- kind-of@3.2.2 deduped
| | | | | +-- isobject@2.1.0
| | | | | | `-- isarray@1.0.0 deduped
| | | | | +-- randomatic@1.1.6
| | | | | | +-- is-number@2.1.0 deduped
| | | | | | `-- kind-of@3.2.2 deduped
| | | | | +-- repeat-element@1.1.2 deduped
| | | | | `-- repeat-string@1.6.1 deduped
| | | | +-- preserve@0.2.0
| | | | `-- repeat-element@1.1.2
| | | +-- expand-brackets@0.1.5
| | | | `-- is-posix-bracket@0.1.1
| | | +-- extglob@0.3.2
| | | | `-- is-extglob@1.0.0 deduped
| | | +-- filename-regex@2.0.1
| | | +-- is-extglob@1.0.0 deduped
| | | +-- is-glob@2.0.1 deduped
| | | +-- kind-of@3.2.2
| | | | `-- is-buffer@1.1.5
| | | +-- normalize-path@2.1.1
| | | | `-- remove-trailing-separator@1.0.1
| | | +-- object.omit@2.0.1
| | | | +-- for-own@0.1.5
| | | | | `-- for-in@1.0.2
| | | | `-- is-extendable@0.1.1
| | | +-- parse-glob@3.0.4
| | | | +-- glob-base@0.3.0
| | | | | +-- glob-parent@2.0.0 deduped
| | | | | `-- is-glob@2.0.1 deduped
| | | | +-- is-dotfile@1.0.3
| | | | +-- is-extglob@1.0.0 deduped
| | | | `-- is-glob@2.0.1 deduped
| | | `-- regex-cache@0.4.3
| | | +-- is-equal-shallow@0.1.3
| | | | `-- is-primitive@2.0.0 deduped
| | | `-- is-primitive@2.0.0
| | +-- async-each@1.0.1
| | +-- glob-parent@2.0.0
| | | `-- is-glob@2.0.1 deduped
| | +-- inherits@2.0.3 deduped
| | +-- is-binary-path@1.0.1
| | | `-- binary-extensions@1.8.0
| | +-- is-glob@2.0.1
| | | `-- is-extglob@1.0.0
| | +-- path-is-absolute@1.0.1 deduped
| | `-- readdirp@2.1.0
| | +-- graceful-fs@4.1.11 deduped
| | +-- minimatch@3.0.4
| | | `-- brace-expansion@1.1.7
| | | +-- balanced-match@0.4.2
| | | `-- concat-map@0.0.1
| | +-- readable-stream@2.2.10 deduped
| | `-- set-immediate-shim@1.0.1
| `-- graceful-fs@4.1.11 deduped
+-- webpack-sources@0.2.3
| +-- source-list-map@1.1.2
| `-- source-map@0.5.6 deduped
`-- yargs@6.6.0
+-- camelcase@3.0.0
+-- cliui@3.2.0
| +-- string-width@1.0.2 deduped
| +-- strip-ansi@3.0.1 deduped
| `-- wrap-ansi@2.1.0
| +-- string-width@1.0.2 deduped
| `-- strip-ansi@3.0.1 deduped
+-- decamelize@1.2.0
+-- get-caller-file@1.0.2
+-- os-locale@1.4.0
| `-- lcid@1.0.0
| `-- invert-kv@1.0.0
+-- read-pkg-up@1.0.1
| +-- find-up@1.1.2
| | +-- path-exists@2.1.0
| | | `-- pinkie-promise@2.0.1 deduped
| | `-- pinkie-promise@2.0.1
| | `-- pinkie@2.0.4
| `-- read-pkg@1.1.0
| +-- load-json-file@1.1.0
| | +-- graceful-fs@4.1.11 deduped
| | +-- parse-json@2.2.0
| | | `-- error-ex@1.3.1
| | | `-- is-arrayish@0.2.1
| | +-- pify@2.3.0
| | +-- pinkie-promise@2.0.1 deduped
| | `-- strip-bom@2.0.0
| | `-- is-utf8@0.2.1
| +-- normalize-package-data@2.3.8
| | +-- hosted-git-info@2.4.2
| | +-- is-builtin-module@1.0.0
| | | `-- builtin-modules@1.1.1
| | +-- semver@5.3.0
| | `-- validate-npm-package-license@3.0.1
| | +-- spdx-correct@1.0.2
| | | `-- spdx-license-ids@1.2.2
| | `-- spdx-expression-parse@1.0.4
| `-- path-type@1.1.0
| +-- graceful-fs@4.1.11 deduped
| +-- pify@2.3.0 deduped
| `-- pinkie-promise@2.0.1 deduped
+-- require-directory@2.1.1
+-- require-main-filename@1.0.1
+-- set-blocking@2.0.0
+-- string-width@1.0.2
| +-- code-point-at@1.1.0
| +-- is-fullwidth-code-point@1.0.0
| | `-- number-is-nan@1.0.1
| `-- strip-ansi@3.0.1 deduped
+-- which-module@1.0.0
+-- y18n@3.2.1
`-- yargs-parser@4.2.1
`-- camelcase@3.0.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN web@1.0.0 No repository field.
npm WARN web@1.0.0 No license field.
// edit
seems like npm had installation problems with the first time installing koa-webpack, after npm cache clean
everything went fine.
:) glad you figured it out
Strange, I'm facing the exact same issue - pretty much same message:
Error: Cannot find module 'babel-runtime/core-js/object/assign'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (D:\Dev\_Projects\Test\worker2\node_modules\koa-webpack\dist\index.js:7:15)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
This is from a fresh install, and I've done it a couple times and updated my npm and node versions to the latest... Don't know what's up.
npm cache clean
does nothing for me. Could be something to do with windows I guess. These things are never easy to debug...
I see it has popped up on other modules too: gilbarbara/react-joyride#107
EDIT: Solved it now by pushing require("koa-webpack")
to an unexecuted area of my production code (previously I was importing it at the top of the file and only using it for development) - the actual importing it in production was causing the problem.
yeah you don't want koa-webpack executing in production code. it's strictly for testing/dev.
Mentioned it in the PR (in more detail) as well, but for anyone else stumbling across this. Add a dependency on babel-runtime to your project for now.