2016-11-09 167 views
3

我最近一直在用Meteor和React起飞。我遵循Meteor网站上的tutorial,没有任何问题。尝试服务Meteor应用程序时出现'babel-runtime'错误

然后我试着创建另一个项目,试图关注另一个tutorial(对于Meteor的旧版本)。沿线的某个地方,流星开始抛出隐晦的错误。在尝试重新开始之后,我最终重新安装了流星,并且它停止了抱怨。

但是,我又遇到了同样的问题。具体地说,创建一个全新的项目后:

meteor create myproject 
cd myproject 
meteor 

服务器抛出了以下错误:

[...] 
W20161109-03:53:42.862(1)? (STDERR) Error: The babel-runtime npm package could not be found in your node_modules 
W20161109-03:53:42.862(1)? (STDERR) directory. Please run the following command to install it: 
W20161109-03:53:42.863(1)? (STDERR) 
W20161109-03:53:42.863(1)? (STDERR) meteor npm install --save babel-runtime 
[...] 

我做什么我被告知并尝试安装babel-runtime包。服务器管理顺利功成,但随后在运行时抛出了以下错误:

Uncaught Error: Cannot find module 'babel-runtime/helpers/slicedToArray' 
at Function.require.resolve 

这一切仍在工作掀起了新创建的项目,安装或更改代码没有额外的软件包。我已经尝试在网上寻找解决方案,但是,虽然有很多引用已修复的错误,但我还没有发现任何东西。在计算器上一对夫妇的(问题)Babel - Error: Cannot find module 'babel-runtime/helpers/typeof'建议如下:

  1. 重新安装NPM模块 室射频node_modules 流星NPM安装

  2. 更新NPM 流星NPM更新-g NPM

我使用流星1.4.2,NPM 3.10.9,Ubuntu 16.04.1。

+0

相同:/流星更新最后更新[email protected] => [email protected]它根本不起作用:( –

+0

=> https://github.com/meteor /流星/问题/ 8032 –

回答

6

我遇到了同样的问题。一个小挖之后,发现这一点:https://github.com/meteor/meteor/issues/8019

* Installing the `babel-runtime` npm package in your application 
    `node_modules` directory is now required for most Babel-transformed code 
    to work, as the Meteor `babel-runtime` package no longer attempts to 
    provide custom implementations of Babel helper functions. 
Consider trying it out by using the latest release candidate (not officially released yet): 

meteor update --release 1.4.2.1-rc.1 
And then: 

meteor npm install --save babel-runtime 

升级到1.4.2.1-RC.1(以及随后今天上午11/9升级到1.4.2.1)后,错误就解决了。

0

尝试增加你的项目目录中的package.json文件,然后运行 流星

npm install --save babel-runtime

在命令行。

相关问题