Search code examples
node.jsubuntustrongloop

Error "npm install -g strongloop" in ubuntu


$ 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 graceful-fs@^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

Solution

  • You can get the Python executable path:

    whereis python
    

    And set it:

    npm config set python /usr/bin/python