{"action":"created","issue":{"url":"https://api.github.com/repos/pixijs/pixi.js/issues/4771","repository_url":"https://api.github.com/repos/pixijs/pixi.js","labels_url":"https://api.github.com/repos/pixijs/pixi.js/issues/4771/labels{/name}","comments_url":"https://api.github.com/repos/pixijs/pixi.js/issues/4771/comments","events_url":"https://api.github.com/repos/pixijs/pixi.js/issues/4771/events","html_url":"https://github.com/pixijs/pixi.js/issues/4771","id":306380996,"number":4771,"title":"Getting Pixi.js working with Node.js...","user":{"login":"stacepellegrino","id":9366114,"avatar_url":"https://avatars1.githubusercontent.com/u/9366114?v=4","gravatar_id":"","url":"https://api.github.com/users/stacepellegrino","html_url":"https://github.com/stacepellegrino","followers_url":"https://api.github.com/users/stacepellegrino/followers","following_url":"https://api.github.com/users/stacepellegrino/following{/other_user}","gists_url":"https://api.github.com/users/stacepellegrino/gists{/gist_id}","starred_url":"https://api.github.com/users/stacepellegrino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stacepellegrino/subscriptions","organizations_url":"https://api.github.com/users/stacepellegrino/orgs","repos_url":"https://api.github.com/users/stacepellegrino/repos","events_url":"https://api.github.com/users/stacepellegrino/events{/privacy}","received_events_url":"https://api.github.com/users/stacepellegrino/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-03-19T09:08:46Z","updated_at":"2018-03-23T18:01:16Z","closed_at":null,"author_association":"NONE","body":"To whom it may concern,\r\n\r\nHaving a real basic problem here. Cannot get Pixi.js examples working with Node.js.\r\n\r\nThis is what I tried...\r\n\r\n```\r\n$ npm install pixi\r\n\r\n$ cat main.js\r\n// Require pixi module\r\nvar pixi = require('pixi');\r\n \r\n// You can use either WebGLRenderer or CanvasRenderer\r\nvar renderer = pixi.WebGLRenderer(800, 600);\r\ndocument.body.appendChild(renderer.view);\r\n \r\nvar stage = new pixi.Stage();\r\nvar bunnyTexture = pixi.Texture.fromImage(\"bunny.png\");\r\nvar bunny = new pixi.Sprite(bunnyTexture);\r\n \r\nbunny.position.x = 400;\r\nbunny.position.y = 300;\r\nbunny.scale.x = 2;\r\nbunny.scale.y = 2;\r\n \r\nstage.addChild(bunny);\r\n \r\nrequestAnimationFrame(animate);\r\n \r\nfunction animate() {\r\n    bunny.rotation += 0.01;\r\n \r\n    renderer.render(stage);\r\n \r\n    requestAnimationFrame(animate);\r\n}\r\n\r\n\r\n$ node main.js\r\n/Users/spellegrino/node.js/pixi.js/node_modules/pixi/platform.js:11\r\n!function(a){\"use strict\";module.exports={global:a,console:a.console,document:a.document,location:a.location,navigator:a.navigator,window:a.window,createCanvas:function(){return a.document.createElement(\"canvas\")},createImage:function(){return new a.Image},createRequest:function(){return new a.XMLHttpRequest}}}(\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{});\r\n                                                                                                                                                                                            ^\r\n\r\nTypeError: Cannot read property 'createElement' of undefined\r\n    at Object.module.exports.createCanvas (/Users/spellegrino/node.js/pixi.js/node_modules/pixi/platform.js:11:189)\r\n    at Object.WebGLRenderer (/Users/spellegrino/node.js/pixi.js/node_modules/pixi/renderers/webgl/WebGLRenderer.js:11:134)\r\n    at Object.<anonymous> (/Users/spellegrino/node.js/pixi.js/tmp/main.js:5:21)\r\n    at Module._compile (module.js:409:26)\r\n    at Object.Module._extensions..js (module.js:416:10)\r\n    at Module.load (module.js:343:32)\r\n    at Function.Module._load (module.js:300:12)\r\n    at Function.Module.runMain (module.js:441:10)\r\n    at startup (node.js:139:18)\r\n    at node.js:968:3\r\n```\r\n\r\nWhat am I doing wrong?\r\n\r\n\r\nKind regards,\r\n\r\n-Stacey Pellegrino"},"comment":{"url":"https://api.github.com/repos/pixijs/pixi.js/issues/comments/375752114","html_url":"https://github.com/pixijs/pixi.js/issues/4771#issuecomment-375752114","issue_url":"https://api.github.com/repos/pixijs/pixi.js/issues/4771","id":375752114,"user":{"login":"Prozi","id":3052357,"avatar_url":"https://avatars2.githubusercontent.com/u/3052357?v=4","gravatar_id":"","url":"https://api.github.com/users/Prozi","html_url":"https://github.com/Prozi","followers_url":"https://api.github.com/users/Prozi/followers","following_url":"https://api.github.com/users/Prozi/following{/other_user}","gists_url":"https://api.github.com/users/Prozi/gists{/gist_id}","starred_url":"https://api.github.com/users/Prozi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Prozi/subscriptions","organizations_url":"https://api.github.com/users/Prozi/orgs","repos_url":"https://api.github.com/users/Prozi/repos","events_url":"https://api.github.com/users/Prozi/events{/privacy}","received_events_url":"https://api.github.com/users/Prozi/received_events","type":"User","site_admin":false},"created_at":"2018-03-23T18:01:16Z","updated_at":"2018-03-23T18:01:16Z","author_association":"NONE","body":"global.window instead of const window\r\nalso why not use my pixi-shim ?\r\njust `const PIXI = require('pixi-shim')`"}}
{"actor":{"display_login":"Prozi"}}