Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
meteorBabel
✓ import meteorBabel from 'meteor-babel'
✗ const meteorBabel = require('meteor-babel')
Default import is the main entry; CommonJS require also works but ESM preferred.
compile
✓ import { compile } from 'meteor-babel'
✗ const compile = require('meteor-babel').compile
Named export for compile function; tree-shakeable with ESM.
setCacheDir
✓ import { setCacheDir } from 'meteor-babel'
✗ import setCacheDir from 'meteor-babel/setCacheDir'
setCacheDir is a named export, not a subpath export.
Shows how to import meteor-babel and use compile function and Babel class to transpile ES6 code.
import meteorBabel from 'meteor-babel';
import { compile } from 'meteor-babel';
const sourceCode = `
const x = (a, b) => a + b;
export default x;
`;
// Compile with default options
const result = compile(sourceCode, {});
console.log(result.code);
// Or use the meteorBabel object for more control
const babelInstance = new meteorBabel.Babel();
const transformed = babelInstance.transform(sourceCode, {
filename: 'test.js',
sourceMaps: true,
});
console.log(transformed.code);
Debug
Known issues
breakingIn v7.11.0, default Babel plugins changed. Existing projects may break if relying on removed plugins.fixUpdate your .babelrc or Babel configuration to explicitly include any missing plugins.
affects: >=7.11.0 <7.13.0
deprecatedsetCacheDir() is deprecated as of v7.12.0; caching is now automatic.fixRemove calls to setCacheDir(); no action needed.
affects: >=7.12.0
gotchameteor-babel requires Node.js >= 10. Installing on older Node versions may fail silently.fixUpgrade Node.js to version 10 or higher.
affects: >=7.0.0
breakingIn v7.13.0, the 'loose' option for class transforms changed default behavior. See migration guide.fixSet 'loose' option explicitly in Babel config if relying on previous behavior.
affects: >=7.13.0
gotchaWhen using with Meteor, do not call compile() directly in production; use Meteor's build plugin.fixUse the meteor-babel package only as a dependency for Meteor's build system, not for direct invocation.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'meteor-babel'
Package not installed or misspelled.
fixRun 'npm install meteor-babel' and ensure import path is correct.
TypeError: meteorBabel.compile is not a function
Importing default instead of named 'compile'.
fixUse 'import { compile } from 'meteor-babel''. SyntaxError: Unexpected token =>
Source code not transpiled; compile() not used or options missing.
fixEnsure compile() is invoked on the source with correct options like { presets: ['meteor'] }. Error: Could not find any Babel presets or plugins
Missing Babel configuration.
fixAdd a .babelrc file with presets/plugins or pass options to compile().
Audit
Dependencies
No dependency data recorded yet.