2011-08-11 17 views
4

我在Windows下使用NodeJS(使用從NodeJS站點下載的node.exe)。我想用這個db-mysql擴展它(https://github.com/mariano/node-db-mysql/如何在Windows下爲NodeJS使用db-mysql擴展?

我不知道如何使用它。是否有必要重新構建整個node.exe,還是隻能構建擴展?按照安裝說明所述,我無法使用node.exe運行NPM(它導致錯誤)。

感謝

+0

我的建議是,Ubuntu 10是一個偉大的操作系統,超級簡單易用。我在Rails上說過,並且不會回到Windows web-dev –

+0

最後,我使用Cygwin,對此我非常滿意。 –

+0

我的建議是,Windows 7是一個偉大的操作系統,超級簡單易用。我開始使用PHP,並且不會轉回到Ubuntu web-dev – Sliq

回答

1

對於我所知的所有,不能將NPM(節點包管理器)與Windows可執行文件node.exe一起使用。

相反,您應該從https://github.com/mariano/node-db-mysql/downloads下載zip/tar模塊並將內容放置到腳本上方的* node_modules *文件夾中。

實施例結構:

/nodestuff 
    /node_modules 
    /db-mysql // The module 
    /script 
    app.js // Your script 

然後只要按照以創建數據庫連接上https://github.com/mariano/node-db-mysql/說明書。 祝你好運。