2017-02-25 42 views
0

我有麻烦我的Windows机器上设置一个PIXI项目。节点早午餐和PIXI.js在Windows上,模块“查询字符串”未找到

这很容易重现:

npm install -g brunch

brunch new .

npm install --save-dev pixi.js

然后插入require("pixi.js")地方(例如initialize.js)和

npm run start

打开localhost:3333并有以下错误:

Uncaught Error: Cannot find module 'querystring' from 'url/url.js' 
    at require (app.js:61) 
    at expanded (app.js:34) 
    at app.js:147 
    at url.js:104 
    at url.js:737 
    at initModule (app.js:42) 
    at require (app.js:59) 
    at expanded (app.js:34) 
    at app.js:147 
    at determineCrossOrigin.js:10 

它完美一台Linux机器(Debian的),但我总能得到我的Windows机器上的这个错误。

$ node -v 
v6.9.5 

$ npm -v 
4.2.0 

$ systeminfo | grep "OS" 
OS Name:     Microsoft Windows 10 Pro 
OS Version:    10.0.14393 N/A Build 14393 

麻烦的模块是pixi。如果我安装并需要任何其他模块,它工作正常。它还如果我安装明确的查询字符串(npm install querystring)是不行的,虽然它是一个内置的模块。

任何想法?

+0

没有问题对我来说,当我尝试过。没有提供任何投诉。安装也许你已经“损坏/错” NPM模块。我认为它可能是值得尝试清除它并重新安装它们:http://stackoverflow.com/a/34344080/1523545 – Hachi

+0

@Hachi你好,我认为这是Windows的问题。上述指令完美地在linux上运行。 – ohyou

回答

0

我知道了使用亭子解决。不过这是一个解决方法。

npm install -g bower

bower install --save pixi.js

然后PIXI对象将是全球范围内提供开箱即用的。只需在你的代码中使用它。