Within a docker build, Modules dependant on node-gyp fail (only where npm-shrinkwap in use)
See original GitHub issueNot sure which is the best place for this,
We are using a number of npm packages which in turn have a dependancy on node-gyp,
i.e. my project does not directly use node-gyp
We run npm-install as part of our docker image build process…
When I put a npm-shrinkwrap.json in place the npm install is failing due to errors relating to python not being in place…
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:449:14)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:353:11
gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:69:16)
gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:81:29)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:90:16
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Linux 4.4.0-59-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
Maybe I need to include a python install as part of pre-build
But my confusion is, why is would fail for this reason only when the npm-shrinkwrap is in place?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Error with node-sass when running npm install - Stack Overflow
Best answer - I was frustrated at every project with node-sass' exhausting installation process. npm install sass just works as expected and ...
Read more >Configuring your application's dependencies - AWS Elastic ...
The npm install command installs the dependencies in the node_modules directory, which Elastic Beanstalk creates beforehand.
Read more >rushstack/rushstack - Gitter
After compiling your monorepo, it seems like the simplest deployment solution would be to publish the built packages to a private NPM registry...
Read more >npm-scripts - w3resource
The script property of your package.json is supported by npm, ... npm defaults the install command to compile using node-gyp.
Read more >NPM install error - Material Design for Bootstrap
p>Trying to install MDB pro 4.19.2 just downloaded and ran npm install but getting this error ... Node-gyp failed to build your package....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
My solution was to modify my docker image to install the dependancies of node-gyp: make, GCC and python
So that the node-gyp script could run.
As to why the behaviour is different from the shrinkwrap non skrinkwrapped is still a bit of a mystery to me
Hi, I can’t share the exact Dockerfile, as it’s not an open source project, for now I’ll create a gist…
https://gist.github.com/vidhill/0a85dc1848feee4171944dc4d7757895
-this is an untested Dockerfile because I’m off to bed now… if this doesn’t help I can create a proper mini-project