[英]Can't find Python executable
Error: Can't find Python executable "D:\\Python", you can set the PYTHON env variable. at PythonFinder.failNoPython (C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\lib\\configure.js:483:19)
我在D:\\Python
安裝了python(2.7.14),並設置了環境變量
我也嘗試過SET PYTHON=D:\\Python
。
命令行的python
命令工作正常。
我究竟做錯了什么 ?
事實證明node-gyp
不從windows環境中獲取變量,你必須像這樣設置它們:
npm config set python D:\\python
我正在安裝sharp
,而不是node-gyp
,這就是為什么我沒有注意他們有這個命令的文檔:
npm install --global --production windows-build-tools
它將為您安裝所有並設置路徑。 我使用了這個命令,終於能夠成功運行npm install
。
注意:您需要以管理員身份運行此命令
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.