我最近开始使用 Meteor 和 React。我跟着tutorial在 Meteor 网站上没有问题。
然后我尝试创建另一个项目,尝试遵循另一个项目tutorial(对于旧版本的 Meteor)。在这个过程中,Meteor 开始抛出一些难以理解的错误。在尝试重新开始后,我最终重新安装了 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 - 错误:找不到模块“babel-runtime/helpers/typeof”StackOverflow 上提出了以下建议:
重新安装 NPM 模块
rm -rf 节点模块
流星 npm 安装
更新 NPM
流星 npm 更新 -g npm
我正在使用 Meteor 1.4.2、NPM 3.10.9、Ubuntu 16.04.1。
我也有同样的问题。经过一番挖掘,发现了这一点: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)后,错误得到解决。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)