簡體   English   中英

從 Mingw32 在 Windows 上編譯節點時如何設置環境變量?

[英]How to set env variables when compiling Node on Windows, from Mingw32?

我正在按照各種 Wiki 中關於如何編譯 Node 的說明進行操作,因此我最終可以讓它在 Windows 上作為服務運行。

到目前為止我的步驟:

  1. https://github.com/joyent/node/wiki/Installation (導致...)
  2. http://blog.tatham.oddie.com.au/2011/03/16/node-js-on-windows/ (通過cygwin成功編譯,但導致...)
  3. https://github.com/joyent/node/wiki/Building-node.js-on-mingw (這顯然比迄今為止成功的cygwin編譯要好)

所以 - 我已經設法使用 Cygwin 編譯 Node.exe,但不是首選的 Mingw。 我同意這不是一個理想的情況,建立在 Windows 上並不理想。 盡管如此。

一旦我按照上述所有步驟操作,我在 Mingw 中看到的錯誤就會在我嘗試./configure --without-ssl時發生。 錯誤信息是:

Danjah@PC /c/cygwin/home/Danjah/node-v0.4.7/node
$ ./configure –without-ssl
/usr/bin/env: python: No such file or directory

I understand from step 3's URL, that I must take steps to provide the environment variables for both Python and Git - using help from the provided URL I managed to input the Python path var, but I don't think I have the Git path var正確的。 無論哪種方式,在 Python、Cygwin 或 Mingw32 的安裝目錄中,我都看到錯誤消息中指定的路徑:“ /usr/bin/env ”。

就環境變量或 Mingw32 而言,谷歌搜索並沒有真正帶來太多好處,我得到的最好的是: PATH=C:\MinGW\bin;C:\MinGW\msys\1.0\bin我的安裝目錄位於C:\MingW\

The path I added to Windows environment vars for Python was: PythonPath=C:\Python27;C:\Python27\DLLs;C:\Python27\Lib;C:\Python27\Lib\lib-tk where Python 2.7 is installed in C:\Python27\

當文件路徑阻止你做事時,我討厭它,因為我懷疑是這里的問題。 所以請在這里直截了當-是我遇到的文件路徑問題還是其他問題? 如果還有其他問題,請嘗試幫助我讓 Node 啟動並運行......熱衷於進行實驗。

I should probably also mention that I do also have a previously installed version of Git on my Windows XP SP3 machine, but had not previously had Cygwin, Mingw32 or Python installed, and I do not have IIS running as a service - my usual testing environment是一個 WAMP 堆棧。

Windows 使用 PATH 環境變量來定位在沒有完全限定文件路徑的情況下調用的程序,即“python”而不是“C:\Python27\python”。

因此,您需要python 的主目錄添加到 Windows PATH 變量,以及MinGW、git 和腳本所需的任何其他內容。

此外,通過在 shell session 或腳本中明確設置 PATH 變量,您將覆蓋其原始內容(在本地上下文中),這限制了您的 Z2591C98B70119FE624898B1E424B 中的哪些程序通常只能在 PATHE4B5 中找到。

See http://www.java.com/en/download/help/path.xml for details on modifying your PATH so you can always run your Python scripts from the command line.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM