我刚刚在 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/