ReferenceError: Can't find variable: require at

前端 未结 3 1847
无人及你
无人及你 2020-12-11 18:05

I have a question about using jasmine with Grunt. I keep getting an error,

ReferenceError: Can\'t find variable: require at

whenever I run

3条回答
  •  一生所求
    2020-12-11 18:14

    The solution that @user3741597 is suggesting might work, but it is a bit of a backwards solution.

    "grunt-template-jasmine-requirejs" was written for RequireJS, which is an AMD loader. On the other hand, you are using CommonJS syntax. If you want to continue to use "grunt-contrib-jasmine", then you need to find a CommonJS template, or else use the information that Jasmine has node support built-in and take a different approach.

    This post may help as well.

提交回复
热议问题