Nodejs jQuery needs jsdom

后端 未结 5 1087
执笔经年
执笔经年 2021-01-12 17:13
$.getJSON(\'https://api.twitch.tv/kraken/channels/\' + SLoppierKitty7, function(channel) {

if (channel[\"stream\"] == null) { 
    var live =\"no\"

} else {

              


        
5条回答
  •  走了就别回头了
    2021-01-12 18:00

    I faced the same issue, and while debugging I came to know about something new.

    When you do -

    npm install jQuery
    

    It installs the jQuery version 1.7.4 to your project.

    And when you do -

    npm install jquery
    

    It installs the jQuery version 3.2.1 to your project.

    The difference between both the command is just the uppercase Q. So if you are getting this error then you are probably using the old version of jQuery.

    You can read more about the first command (the old version) here and about the second command here.

提交回复
热议问题