我想通过jsDom在服务器上呈现chartsjs。 我有一个使用node.js & Express的工作版本。 目前关于每当我添加以下代码与jsDOM和流星意外的令牌错误
var jsdom = require('jsdom');
我收到以下错误流星项目:
W20170615-20:30:17.440(2)? (STDERR) packages\modules.js:397
W20170615-20:30:17.456(2)? (STDERR) const { URL } = require("whatwg-url");
W20170615-20:30:17.460(2)? (STDERR) ^
W20170615-20:30:17.461(2)? (STDERR)
W20170615-20:30:17.463(2)? (STDERR) SyntaxError: Unexpected token {
W20170615-20:30:17.465(2)? (STDERR) at Object.exports.runInThisContext (vm.j
s:53:16)
W20170615-20:30:17.470(2)? (STDERR) at C:\x\x\x\x\x
pp\.meteor\local\build\programs\server\boot.js:331:30
W20170615-20:30:17.472(2)? (STDERR) at Array.forEach (native)
W20170615-20:30:17.473(2)? (STDERR) at Function._.each._.forEach (C:\x\K
x\x\Local\.meteor\packages\meteor-tool\1.5.0\mt-os.windows.x86_32\dev
_bundle\server-lib\node_modules\underscore\underscore.js:79:11)
W20170615-20:30:17.475(2)? (STDERR) at C:\x\x\x\x\x
pp\.meteor\local\build\programs\server\boot.js:158:5
W20170615-20:30:17.476(2)? (STDERR) at C:\x\x\x\x\x
pp\.meteor\local\build\programs\server\boot.js:387:5
W20170615-20:30:17.478(2)? (STDERR) at Function.run (C:\x\x\x
p\x\x\.meteor\local\build\programs\server\profile.js:510:12)
W20170615-20:30:17.479(2)? (STDERR) at C:\x\x\x\x\x
pp\.meteor\local\build\programs\server\boot.js:386:11
=> Exited with code: 1
版本 - 的NodeJS:V7.8 - jsDom:11.0.0 - 流星:1.5
复制的问题做到以下几点:
- 运行流星创建--full jsDomTest
- CD jsDomTest
- 流星NPM安装
- NPM安装jsdom --save
- 根服务器文件夹中添加以下行
var jsdom = require('jsdom');
- 来看流星
我不确定目前如何解决这个问题。 任何帮助,将不胜感激谢谢。
您可以尝试并发布演示问题的简单控制台应用程序吗?我无法复制。 – akaphenom
@akaphenom感谢您的回复。我添加到我的原始后步骤复制。我只是自己跑了那些步骤和同样的问题。 – eGlu
您是否执行过'meteor npm install'安装所有必需的模块? – Khang