【问题标题】:Illegal token in meteor/node module => cookies流星/节点模块中的非法令牌 => cookie
【发布时间】:2014-04-30 13:02:18
【问题描述】:

当我遇到此持续错误时,我正试图跟随 g00glen00b 的流星/推特演练 (http://g00glen00b.be/meteor-twitter-streaming/)。任何帮助或提示都会非常感激。

我尝试过的事情

  • 卸载/重新安装 npm
  • 卸载/重新安装 twitter 包
  • 卸载/重新安装 cookie
  • 搜索隐藏字符

我部署的应用程序

(htp://dbcmarch.meteor.com)

流星错误

 => Errors prevented startup:

While building the application:
node_modules/twitter/node_modules/cookies/test/express.js:1:15: Unexpected token ILLEGAL
node_modules/twitter/node_modules/cookies/test/http.js:1:15: Unexpected token ILLEGAL

express.js

#!/usr/bin/env node

var assert = require("assert"),
    express = require("express"),

http.js

#!/usr/bin/env node

var assert = require("assert"),
    http = require("http"),

【问题讨论】:

  • shebang 表达式是问题所在,它不是有效的语法。要执行它,你需要给你的脚本chmod +x,然后你可以像./file.js一样运行它,但你不需要它,我认为你在滥用它。
  • @elclanrs 我运行了哪个节点,它指向 => /usr/bin/node,所以我不确定这是否是问题所在。我还在测试目录上运行 chmod +X 没有效果。

标签: javascript node.js twitter meteor meteorite


【解决方案1】:

meteor 包括 npm,运行 'mrt add npm' 完全可以接受,但是不应该使用 npm 将其软件包(例如 npm install twitter)安装到流星项目中。您可以通过 packages.json 文件要求它们。

为了避免非法令牌错误并让服务器正常运行,我删除了项目文件夹中的主 node_module 目录。

查看流星谷歌组的建议!

【讨论】:

    猜你喜欢
    • 2015-12-16
    • 1970-01-01
    • 2018-02-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-12
    • 2016-06-18
    相关资源
    最近更新 更多