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

au build cannot find module babel-runtime #443

Closed
lebolo opened this issue Dec 19, 2016 · 7 comments
Closed

au build cannot find module babel-runtime #443

lebolo opened this issue Dec 19, 2016 · 7 comments

Comments

@lebolo
Copy link
Contributor

lebolo commented Dec 19, 2016

I'm submitting a bug report

  • Library Version:
    aurelia-cli: 0.23.0 (see output of npm ls --depth=0 below)
    I notice that aurelia-cli installs its own version of npm@3.10.10 even though I have npm@4.0.5 installed globally

Please tell us about your environment:

  • Operating System:
    Windows 7

  • Node Version:
    7.2.1

  • NPM Version:
    4.0.5

  • Language:
    ESNext

Current behavior:
When I try to build via au build I get the error below. I have tried starting from scratch:

  1. Install latest node version using nvm (node 7.2.1)
  2. npm install npm -g (npm@4.0.5)
  3. npm install aurelia-cli -g (aurelia-cli@0.23.0)
  4. npm install
  5. au build
> au build
resolve failed:  { Error: Cannot find module 'babel-runtime'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.requireRelative.resolve (C:\myworkingdir\node_modules\require-relative\index.js:30:17)
    at resolve (C:\myworkingdir\node_modules\modify-babel-preset\lib\serialize.js:26:26)
    at findAndRemove (C:\myworkingdir\node_modules\modify-babel-preset\lib\serialize.js:83:11)
    at C:\myworkingdir\node_modules\modify-babel-preset\lib\serialize.js:126:13
    at Array.map (native)
    at loadPreset (C:\myworkingdir\node_modules\modify-babel-preset\lib\serialize.js:118:29)
    at module.exports (C:\myworkingdir\node_modules\modify-babel-preset\index.js:95:19)
    at Object.<anonymous> (C:\myworkingdir\node_modules\babel-preset-es2015-loose\index.js:5:18)
    at Module._compile (module.js:571:32)
    at Module._extensions..js (module.js:580:10)
    at Object.require.extensions.(anonymous function) [as .js] (C:\myworkingdir\node_modules\babel-register\lib\node.js:152:7)
    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) code: 'MODULE_NOT_FOUND' } babel-runtime
C:\myworkingdir\node_modules\babel-core\lib\transformation\file\options\option-manager.js:334
        throw e;
        ^

TypeError: Cannot read property 'displayName' of undefined (While processing preset: "C:\\myworkingdir\\node_modules\\babel-preset-es2015-loose\\index.js")

I tried npm install babel-runtime explicitly, but that does not work.

Expected/desired behavior:
Aurelia to build successfully.

All project dependencies and their versions

> npm ls --depth=0
+-- aurelia-animator-css@1.0.1
+-- aurelia-bootstrapper@2.0.1
+-- aurelia-cli@0.23.0
+-- aurelia-cookie@1.0.10
+-- aurelia-fetch-client@1.1.0
+-- aurelia-materialize-bridge@0.20.6
+-- aurelia-testing@1.0.0-beta.2.0.1
+-- aurelia-tools@1.0.0
+-- aurelia-validation@0.14.0
+-- babel-eslint@7.1.1
+-- babel-plugin-istanbul@3.0.0
+-- babel-plugin-syntax-flow@6.18.0
+-- babel-plugin-transform-decorators-legacy@1.3.4
+-- babel-plugin-transform-es2015-modules-amd@6.18.0
+-- babel-plugin-transform-es2015-modules-commonjs@6.18.0
+-- babel-plugin-transform-flow-strip-types@6.21.0
+-- babel-polyfill@6.20.0
+-- babel-preset-es2015@6.18.0
+-- babel-preset-es2015-loose@8.0.0
+-- babel-preset-stage-1@6.16.0
+-- babel-register@6.18.0
+-- bluebird@3.4.6
+-- browser-sync@2.18.5
+-- connect-history-api-fallback@1.3.0
+-- gulp@4.0.0-alpha.2 (git://github.com/gulpjs/gulp.git#e9e5ab7e70080e1bfb5650a4fdc4c8849e70b3e0)
+-- gulp-babel@6.1.2
+-- gulp-changed-in-place@2.0.3
+-- gulp-eslint@3.0.1
+-- gulp-notify@2.2.0
+-- gulp-plumber@1.1.0
+-- gulp-rename@1.2.2
+-- gulp-sourcemaps@2.2.1
+-- gulp-tap@0.1.3
+-- gulp-util@3.0.7
+-- jasmine-core@2.5.2
+-- karma@1.3.0
+-- karma-babel-preprocessor@6.0.1
+-- karma-chrome-launcher@2.0.0
+-- karma-coverage@1.1.1
+-- karma-jasmine@1.1.0
+-- karma-requirejs@1.1.0
+-- materialize-css@0.97.8
+-- minimatch@3.0.3
+-- nprogress@0.2.0
+-- requirejs@2.3.2
+-- text@2.0.15 (git://github.com/requirejs/text.git#d04de4ffd7bf5ba6cb80cdca2d40d4f6f52a1b1f)
+-- through2@2.0.3
+-- uglify-js@2.7.5
`-- vinyl-fs@2.4.4
@lebolo
Copy link
Contributor Author

lebolo commented Dec 19, 2016

I've also tried dropping down to node 6.8.1 and npm 3.10.8 to no avail.

@lebolo
Copy link
Contributor Author

lebolo commented Dec 20, 2016

The culprit was when I updated to babel-preset-es2015-loose@8.0.0 (originally Aurelia CLI has it at ^7.0.0). That project is now deprecated if using babel-preset-es2015@6.13.0 or above.

Removing babel-preset-es2015-loose from package.json and using the new preset configuration from that link (in .babelrc file) allows Aurelia to build again.

I'll keep the issue open in case we want to update the CLI config (feel free to close it), but I assume most people are more careful when updating dependencies 😭 so this may not be an issue for others.

@EisenbergEffect
Copy link
Contributor

@lebolo Would you mind submitting a PR to the CLI project for the update? That would be a nice contribution.

@lebolo
Copy link
Contributor Author

lebolo commented Dec 21, 2016

Sure @EisenbergEffect, just to confirm, are you comfortable requiring babel-preset-es2015@6.13.0 (up from 6.9.0 in the current CLI code)?

@EisenbergEffect
Copy link
Contributor

I don't see any issues with that. Are you aware of any problems?

@lebolo
Copy link
Contributor Author

lebolo commented Dec 21, 2016

Actually, reading the releases, we should require at least babel-preset-es2015@6.13.2 (6.13.0 introduced some regression bugs that were fixed in 6.13.2). I'll update the PR and you can squash the commits if you'd like.

@lebolo
Copy link
Contributor Author

lebolo commented Dec 21, 2016

Done, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants