Meteor 1.3 NPM:意外保留字导入 [英] Meteor 1.3 NPM: Unexpected reserved word import

查看:242
本文介绍了Meteor 1.3 NPM:意外保留字导入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想按照此处的指南操作:

I'm trying to follow the guide here:

https://guide.meteor.com/using-packages.html

安装几个节点包,然后尝试导入它们进入我的 methods.js 文件,但得到以下错误:

Installing a few node packages then trying to import them into my methods.js file but Im getting the following error:

W20160423-15:08:57.338(9)? (STDERR) app/server/methods.js:1
W20160423-15:08:57.338(9)? (STDERR) (function(Npm,Assets){(function(){import Fibers from 'fibers';
W20160423-15:08:57.338(9)? (STDERR)                                   ^^^^^^
W20160423-15:08:57.343(9)? (STDERR) SyntaxError: Unexpected reserved word
W20160423-15:08:57.344(9)? (STDERR)     at /repos/myproject/.meteor/local/build/programs/server/boot.js:278:30
W20160423-15:08:57.344(9)? (STDERR)     at Array.forEach (native)
W20160423-15:08:57.344(9)? (STDERR)     at Function._.each._.forEach (/Volumes/320gb/macbookpro/.meteor/packages/meteor-tool/.1.3.2_4.1rz3z4t++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20160423-15:08:57.345(9)? (STDERR)     at /repos/myproject/.meteor/local/build/programs/server/boot.js:133:5



My packages seems to be installed correctly. Not sure what's causing this, Is this a bug?

推荐答案

这个错误发生,如果你不要添加 ecmascript 包。我认为(不确定),这是默认添加的较新的项目,但需要明确地添加从以前版本的流星更新。尝试使用

This error occurs if you don't add ecmascript packages. I think (not sure), this is added by default for newer projects but needs to be added explicitly when updating from previous versions of meteor. Try adding this package using,

meteor add ecmascript

上次我也遇到了类似的问题,我从这个链接

Last time, I also faced similar problem, I came to know about it from this link.

这篇关于Meteor 1.3 NPM:意外保留字导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆