Meteor 1.4.2.3 - 在您的 node_modules 中找不到 babel-runtime npm 包

标签 meteor babeljs

我刚刚在 Ubuntu 服务器上部署了 Meteor 应用程序,安装了所有软件包,但是当我尝试访问该页面时,浏览器控制台不断向我显示此内容

Uncaught Error: 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 t.node_modules.meteor.babel-runtime.babel-runtime.js (a72cdf7….js?meteor_js_resource=true:34)
    at a (a72cdf7….js?meteor_js_resource=true:9)
    at r (a72cdf7….js?meteor_js_resource=true:9)
    at a72cdf7….js?meteor_js_resource=true:34
    at a72cdf7….js?meteor_js_resource=true:34
t.node_modules.meteor.babel-runtime.babel-runtime.js @ a72cdf7….js?meteor_js_resource=true:34
a @ a72cdf7….js?meteor_js_resource=true:9
r @ a72cdf7….js?meteor_js_resource=true:9
(anonymous) @ a72cdf7….js?meteor_js_resource=true:34
(anonymous) @ a72cdf7….js?meteor_js_resource=true:34

我按照要求执行了meteor npm install --save babel-runtime,但它似乎没有效果。

有人遇到同样的错误吗?

提前致谢

最佳答案

请注意,这个错误是从 2017 年开始的。当时有几个人得到了 this GitHub comment 的帮助。 :

Be sure that you npm install before building your production bundle.

$ git clone repo
$ cd repo
$ npm install # IMPORTANT!
$ meteor build --directory ../build

现在在 Meteor 1.8.1 上,我遇到了同样的错误,除了使用 @babel/runtime 而不是 babel-runtime。同样的解决方案仍然有效:在运行 meteor build 之前,在源目录中运行 npm install

关于Meteor 1.4.2.3 - 在您的 node_modules 中找不到 babel-runtime npm 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41498088/

相关文章:

javascript - Babel 加载器错误 : rest/spread operator not understood

javascript - babel-preset-env 语法错误 : Unexpected token with spread properties

javascript - React Native 从外部源加载 JSX 并在运行时对其进行转换

javascript - 当路由不存在时,iron-router 渲染 notFound 模板

javascript - 来自 Meteor 模板的 HTML 图像链接未由浏览器呈现

javascript - Meteor.users.update() 不适用于注销+登录

npm - 类型错误 : Cannot read property 'babel' of undefined

javascript - Meteor/MongoDB 重复数组对象

node.js - Meteor - rxjs@5.0.0-beta.11 或 rxjs@5.0.0-beta.6 未满足的依赖项

javascript - React.js - babel-loader - 意外的 token