【问题标题】:Can't get Intern to run their own tutorial无法让实习生运行他们自己的教程
【发布时间】:2015-11-16 16:57:18
【问题描述】:

我是 NodeJS 的新手,对于实习生来说更是如此,他们试图学习实习生以在工作中进行测试,但无法通过他们自己的教程一步一步地启动实习生客户端,它总是让我返回错误:

C:\testproject\root>node ./node_modules/.bin/intern-client config=tests/intern
C:\testproject\root\node_modules\.bin\intern-client:2
basedir=`dirname "$0"`
    ^
SyntaxError: Unexpected token ILLEGAL
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

我在他们的网站https://github.com/theintern/intern 上关注快速入门,在创建文件夹后,通过 NodeJS 安装实习生并将他们的示例添加到测试/文件夹中。运行他们的脚本对确定他们的教程有什么问题没有帮助。根据他们的示例设置包和非功能套件,但仍然没有成功。

//...
loader: {
    // Packages that should be registered with the loader in each testing environment
    packages: [ { name: 'root', location: '.' } ],
    // map: { 'intern-selftest': { dojo: 'intern-selftest/node_modules/dojo' } }
},

// Non-functional test suite(s) to run in each browser
suites: [ 'root/tests/intern' ],
//...

我对整个项目进行了几次核对,使用了 jslint 和 jshint,并且没有返回任何语法错误。 还尝试了一些不成功的组合:

https://github.com/theintern/intern-tutorial

https://gist.github.com/neonstalwart/6630466

有任何想法或真正可行的示例吗?

提前致谢。

【问题讨论】:

    标签: intern


    【解决方案1】:

    你为什么把node放在命令的开头?没有任何文件说要这样做。您正在尝试使用 Node.js 运行 shell 脚本(需要明确的是,Intern 没有创建该 shell 脚本,您的安装程序创建了该脚本),这将永远无法工作,因为 JavaScript 和 sh 不是相同的语言。

    【讨论】:

      猜你喜欢
      • 2013-05-04
      • 2015-06-18
      • 2019-12-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-13
      • 1970-01-01
      相关资源
      最近更新 更多