Running npm inside a snap cannot find stdlib.h


This snap for openzeppelin is getting very complicated. But I think I’m getting closer. The snap needs to run npm, so I’ve been packaging the most common things that npm usually does. The current problem is that when I run openzeppelin unpack tutorial, which executes npm, it fails with:

/snap/openzeppelin/85/usr/include/c++/7/cstdlib:75:15: fatal error: stdlib.h: No such file or directory

On the snapcraft command environment I’ve added:


And stdlib.h is in there alright:

$ ls /snap/openzeppelin/current/usr/include/stdlib.h 

So I don’t understand why is it not found. Any suggestions? Am I missing something obvious here?

pura vida

Hi elopio - did you manage to resolve this? We’re seeing something similar. Thanks

Hi there!

Have you tried solving this problem with layouts?