javascript - Development workflow with pixi.js and browserify (Error: browserify can't find pixi.js module) -
i started test pixi.js , followed tutorial http://frontender.info/introduction-to-pixijs/ (sorry it's in russian, can translate google translate). liked workflow of tutorial, need use "require" in browser, , need quckly test game in browser. works fine, when request beefy server on url http://localhost:9966/ getting error:
error: cannot find module 'pixi.js' 'c:\users\painkiller\desktop\pixitest' @ c:\users\painkiller\appdata\roaming\npm\node_modules\browserify\node_modules\resolve\lib\async.js:46:17 @ process (c:\users\painkiller\appdata\roaming\npm\node_modules\browserify\node_modules\resolve\lib\async.js:173:43) @ ondir (c:\users\painkiller\appdata\roaming\npm\node_modules\browserify\node_modules\resolve\lib\async.js:188:17) @ load (c:\users\painkiller\appdata\roaming\npm\node_modules\browserify\node_modules\resolve\lib\async.js:69:43) @ onex (c:\users\painkiller\appdata\roaming\npm\node_modules\browserify\node_modules\resolve\lib\async.js:92:31) @ c:\users\painkiller\appdata\roaming\npm\node_modules\browserify\node_modules\resolve\lib\async.js:22:47 @ fsreqwrap.oncomplete (fs.js:123:15)
what i've tried: 1. installed pixi.js different commands. 2. manually put file pixi.js in c:\users\painkiller\desktop\pixitest\node_modules\pixi.js folder (after running install commands there no pixi.js file) 3. put index.html in root of folder with:
<!doctype html> <meta charset="utf-8"> <title>hello world</title> <body> <script src="http://pixijs.download/release/pixi.js"></script> <script src="index.js"></script> <script> //test pixi working console.log(pixi); </script> </body>
when add link index.js file error shows again. current os windows 10, if can help. in advance.
edit: additional info. when run
browserify index.js -o bundle.js
in root folder of project getting same error. pixi.js file located in node_modules/pixi.js folder, why browserify can't find it???
edit2: when put pixi.js in folder, use require in way:
var pixi = require('./node_modules/pixi.js/pixi.js');
browserify find it, gives error:
error: cannot find module './gltexture' 'c:\users\painkiller\desktop\pixite st\node_modules\pixi.js'
still don't know if browserify works pixi.js npm module, issues on github repo says fixed in newer version of pixi.js. anyway if met problem can switch webpack (and did it), or use pixi.js global import (via script tag).
Comments
Post a Comment