root@root:/home/kobida# npm install sharp
> [email protected] install /home/kobida/node_modules/sharp
> node-gyp rebuild
Traceback (most recent call last):
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 13, in <module>
import gyp
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 8, in <module>
import gyp.input
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 5, in <module>
from compiler.ast import Const
ImportError: No module named compiler.ast
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack at ChildProcess.emit (events.js:160:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Linux 4.9.0-5-amd64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/kobida/node_modules/sharp
gyp ERR! node -v v9.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN [email protected] requires a peer of graphql@^0.10.0 || ^0.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of graphql@^0.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of graphql@^0.10.0 || ^0.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of graphql@^0.10.0 || ^0.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-01-11T02_51_28_732Z-debug.log
Hello, the ImportError: No module named compiler.ast error suggests something is wrong with the (conflicting?) Python installation(s) on this machine. Perhaps see #684 as it was a similar problem.
I hit this, and fixes in the linked issue didn't work -- the install process was correctly using my python2 interpreter.
In my case the issue was that the ubuntu:16.04 docker container that I was installing in didn't contain the python dev headers, which appear to be required to get compiler / parser modules.
apt-get install python-dev fixed the problem for me.
I'm also having this issue on...
I tried different sharp versions 0.19.0 and 0.18.4
This problem relates to local Python installations. Please subscribe #186 for updates about a possible Python-less future.
Most helpful comment
I hit this, and fixes in the linked issue didn't work -- the install process was correctly using my python2 interpreter.
In my case the issue was that the
ubuntu:16.04docker container that I was installing in didn't contain the python dev headers, which appear to be required to getcompiler/parsermodules.apt-get install python-devfixed the problem for me.