Running npm inside a snap cannot find stdlib.h


#1

Hello!

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:

CPATH: $CPATH:$SNAP/usr/include:$SNAP/usr/include/$SNAPCRAFT_ARCH_TRIPLET

And stdlib.h is in there alright:

$ ls /snap/openzeppelin/current/usr/include/stdlib.h 
/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