2017-02-25 28 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對象將是全球範圍內提供開箱即用的。只需在你的代碼中使用它。