2016-11-09 163 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

在命令行。

相關問題