I am attempting to draft a new package in the packages
directory within a larger Meteor project (so that I can test out the package and its use at the same time). I’ve worked with the packages
directory before, but I’m not an expert in writing from-scratch Meteor packages, and this package is written in modern ecmascript, so maybe that’s the issue? Anyway, I’m getting this classic error message when running meteor
(in the larger Meteor project):
=> Errors prevented startup:
While loading plugin `compileStaticPug` from package `edemaine:static-pug`:
packages/babel-runtime.js:20:9:
The @babel/runtime npm package could not be found in your node_modules
directory. Please run the following command to install it:
meteor npm install --save @babel/runtime
at module (packages/babel-runtime.js:20:9)
at fileEvaluate (packages/modules-runtime.js:336:7)
at Module.require (packages/modules-runtime.js:238:14)
at require (packages/modules-runtime.js:258:21)
at packages/babel-runtime.js:53:15
at packages/babel-runtime.js:58:3
I’m confused by this message because
-
node_modules/@babel/runtime
exists (in the larger project), and is depended upon bypackage.json
(in the larger project). [And the Meteor project was working fine before I created this package andmeteor add
ed this package.] I’ve also tried deletingnode_modules
and runningmeteor npm install
again. - I didn’t think that packages were supposed to depend on
@babel/runtime
explicitly, only on theecmascript
Meteor package. (To do so would require a specific version, which seems bad.)
Here’s the package’s package.js
(in packages/static-pug/package.js
):
Package.describe({
name: 'edemaine:static-pug',
summary: "Define static page content in .pug files",
version: '0.0.0',
git: 'TODO'
});
Package.registerBuildPlugin({
name: 'compileStaticPug',
use: [
'caching-compiler@1.2.2',
'ecmascript@0.14.3',
'templating-tools@1.1.2',
],
sources: [
'static-pug.js',
],
npmDependencies: {
'pug': '3.0.0',
}
});
Package.onUse(function(api) {
api.use('isobuild:compiler-plugin@1.0.0');
api.imply('meteor@1.2.17', 'client'); // I've tried other versions too
});
I’m on Meteor 1.10.2.
Am I missing something in package.js
?