2016-03-15 91 views
-3
 
$ sudo npm install -g strongloop 

> [email protected] install /usr/lib/node_modules/strongloop/node_modules/heapdump 
> node-gyp rebuild 

gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "/path/to/python", you can set the PYTHON env variable. 
gyp ERR! stack  at failNoPython (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:401:14) 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:330:11 
gyp ERR! stack  at F (/usr/lib/node_modules/npm/node_modules/which/which.js:63:16) 
gyp ERR! stack  at E (/usr/lib/node_modules/npm/node_modules/which/which.js:72:29) 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/which/which.js:81:16 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5 
stack  at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5 
gyp ERR! stack  at FSReqWrap.oncomplete (fs.js:82:15) 
gyp ERR! System Linux 3.13.0-48-generic 
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /usr/lib/node_modules/strongloop/node_modules/heapdump 
gyp ERR! node -v v4.4.0 
gyp ERR! node-gyp -v v3.3.0 
gyp ERR! not ok 
npm WARN optional dep failed, continuing [email protected] 

> [email protected] postinstall /usr/lib/node_modules/strongloop/node_modules/spawn-sync 
> node postinstall 


> [email protected] install /usr/lib/node_modules/strongloop/node_modules/bufferutil 
> node-gyp rebuild 

gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "/path/to/python", you can set the PYTHON env variable. 
gyp ERR! stack  at failNoPython (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:401:14) 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:330:11 
gyp ERR! stack  at F (/usr/lib/node_modules/npm/node_modules/which/which.js:63:16) 
gyp ERR! stack  at E (/usr/lib/node_modules/npm/node_modules/which/which.js:72:29) 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/which/which.js:81:16 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5 
gyp ERR! stack  at FSReqWrap.oncomplete (fs.js:82:15) 
gyp ERR! System Linux 3.13.0-48-generic 
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /usr/lib/node_modules/strongloop/node_modules/bufferutil 
gyp ERR! node -v v4.4.0 
gyp ERR! node-gyp -v v3.3.0 
gyp ERR! not ok 

> [email protected] install /usr/lib/node_modules/strongloop/node_modules/utf-8-validate 
> node-gyp rebuild 

gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "/path/to/python", you can set the PYTHON env variable. 
gyp ERR! stack  at failNoPython (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:401:14) 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:330:11 
gyp ERR! stack  at F (/usr/lib/node_modules/npm/node_modules/which/which.js:63:16) 
gyp ERR! stack  at E (/usr/lib/node_modules/npm/node_modules/which/which.js:72:29) 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/which/which.js:81:16 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5 
gyp ERR! stack  at FSReqWrap.oncomplete (fs.js:82:15) 
gyp ERR! System Linux 3.13.0-48-generic 
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /usr/lib/node_modules/strongloop/node_modules/utf-8-validate 
gyp ERR! node -v v4.4.0 
gyp ERR! node-gyp -v v3.3.0 
gyp ERR! not ok 
npm WARN optional dep failed, continuing [email protected] 

> [email protected] install /usr/lib/node_modules/strongloop/node_modules/modern-syslog 
> node-gyp rebuild 

gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "/path/to/python", you can set the PYTHON env variable. 
gyp ERR! stack  at failNoPython (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:401:14) 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:330:11 
gyp ERR! stack  at F (/usr/lib/node_modules/npm/node_modules/which/which.js:63:16) 
gyp ERR! stack  at E (/usr/lib/node_modules/npm/node_modules/which/which.js:72:29) 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/which/which.js:81:16 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5 
gyp ERR! stack  at FSReqWrap.oncomplete (fs.js:82:15) 
gyp ERR! System Linux 3.13.0-48-generic 
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /usr/lib/node_modules/strongloop/node_modules/modern-syslog 
gyp ERR! node -v v4.4.0 
gyp ERR! node-gyp -v v3.3.0 
gyp ERR! not ok 
npm WARN optional dep failed, continuing [email protected] 
npm WARN optional dep failed, continuing [email protected] 

> [email protected] install /usr/lib/node_modules/strongloop/node_modules/strong-debugger 
> node-gyp rebuild 

gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "/path/to/python", you can set the PYTHON env variable. 
gyp ERR! stack  at failNoPython (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:401:14) 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:330:11 
gyp ERR! stack  at F (/usr/lib/node_modules/npm/node_modules/which/which.js:63:16) 
gyp ERR! stack  at E (/usr/lib/node_modules/npm/node_modules/which/which.js:72:29) 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/which/which.js:81:16 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5 
gyp ERR! stack  at FSReqWrap.oncomplete (fs.js:82:15) 
gyp ERR! System Linux 3.13.0-48-generic 
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /usr/lib/node_modules/strongloop/node_modules/strong-debugger 
gyp ERR! node -v v4.4.0 
gyp ERR! node-gyp -v v3.3.0 
gyp ERR! not ok 

> [email protected] install /usr/lib/node_modules/strongloop/node_modules/strong-agent 
> node-gyp rebuild || exit 0 

gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "/path/to/python", you can set the PYTHON env variable. 
gyp ERR! stack  at failNoPython (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:401:14) 
    at /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:330:11 
gyp ERR! stack  at F (/usr/lib/node_modules/npm/node_modules/which/which.js:63:16) 
gyp ERR! stack  at E (/usr/lib/node_modules/npm/node_modules/which/which.js:72:29) 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/which/which.js:81:16 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5 
gyp ERR! stack  at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5 
gyp ERR! stack  at FSReqWrap.oncomplete (fs.js:82:15) 
gyp ERR! System Linux 3.13.0-48-generic 
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /usr/lib/node_modules/strongloop/node_modules/strong-agent 
gyp ERR! node -v v4.4.0 
gyp ERR! node-gyp -v v3.3.0 
gyp ERR! not ok 
npm WARN optional dep failed, continuing [email protected] 
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to [email protected]^4.0.0 as soon as possible. 

> [email protected] install /usr/lib/node_modules/strongloop/node_modules/node-inspector/node_modules/ws 
> (node-gyp rebuild 2> builderror.log) || (exit 0) 


> [email protected] install /usr/lib/node_modules/strongloop/node_modules/sqlite3 
> node-pre-gyp install --fallback-to-build 
+0

“GYP ERR配置错误GYP ERR!堆栈错误:无法找到Python可执行文件“/ path/to/python”,您可以设置PYTHON env变量。“这个错误信息似乎对我来说足够清晰。请注意,使用node-gyp构建软件包需要使用python 2. *。 –

+0

您已在问题中发布了答案 – emilioriosvz

回答

0

你可以得到Python的可执行文件的路径:

whereis python 

,并设置它!

npm config set python /usr/bin/python