Pwa-studio: [BUG] Fatal error when running 'yarn install'

Created on 5 Feb 2019  ·  7Comments  ·  Source: magento/pwa-studio

The bug
I am getting an fatal error when running yarn install.

To Reproduce
Steps to reproduce the behavior:

  1. yarn install (Step 2 of https://magento-research.github.io/pwa-studio/venia-pwa-concept/setup/)

Preconditions
Docker running with Windows containers
Npm installed

Error

error C:\Users\henkt\pwa\pwa-studionode_modules\iltorb: Command failed.
Exit code: 1
Command: detect-libc prebuild-install || node-gyp rebuild
Arguments:
Directory: C:\Users\henkt\pwa\pwa-studionode_modules\iltorb
Output:
prebuild-install WARN install No prebuilt binaries found (target=10.15.1 runtime=node arch=x64 platform=win32)
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\henkt\AppData\Local\Programs\Python\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:294:12)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at maybeClose (internal/child_process.js:970:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\henkt\pwa\pwa-studio\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\henkt\pwa\pwa-studionode_modules\iltorb

  • Device: PC
  • OS: Windows 10
  • NPM version 6.4.1
  • Node Version 10.15.1
bug

Most helpful comment

For anyone looking to get past this point on Ubuntu (and probably other Debian-based distros too) is:

sudo apt-get install python build-essential

All 7 comments

Similar error here on a fresh Ubuntu 18.10 minimal install:

$ yarn install
yarn install v1.13.0
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > [email protected]" has unmet peer dependency "graphql-tag@^2.0.0".
warning " > @magento/[email protected]" has unmet peer dependency "@babel/runtime@~7.2.0".
warning " > @magento/[email protected]" has unmet peer dependency "react@~16.7.0".
warning " > @magento/[email protected]" has unmet peer dependency "react-dom@~16.7.0".
warning " > @magento/[email protected]" has unmet peer dependency "react-router-dom@~4.4.0-beta.6".
warning " > @magento/[email protected]" has unmet peer dependency "express@~4.16.4".
warning "workspace-aggregator-c0fe5971-4919-475a-9e2a-5fa72a529725 > @magento/peregrine > @storybook/[email protected]" has unmet peer dependency "babel-loader@^7.0.0 || ^8.0.0".
warning "workspace-aggregator-c0fe5971-4919-475a-9e2a-5fa72a529725 > @magento/pwa-buildpack > @magento/[email protected]" has unmet peer dependency "sharp@^0.21.2".
warning "workspace-aggregator-c0fe5971-4919-475a-9e2a-5fa72a529725 > @magento/venia-concept > [email protected]" has unmet peer dependency "prop-types@>= 15".
warning "workspace-aggregator-c0fe5971-4919-475a-9e2a-5fa72a529725 > @magento/peregrine > @storybook/react > @storybook/[email protected]" has unmet peer dependency "babel-loader@^7.0.0 || ^8.0.0".
warning "workspace-aggregator-c0fe5971-4919-475a-9e2a-5fa72a529725 > @magento/peregrine > @storybook/react > @emotion/styled > @emotion/[email protected]" has unmet peer dependency "@emotion/[email protected]".
[5/5] Building fresh packages...
[1/7] ⠐ iltorb
[2/7] ⠐ husky
[3/7] ⠐ iltorb
[4/7] ⠐ node-zopfli-es
error /home/rowan/src/pwa-studio/node_modules/node-zopfli-es: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /home/rowan/src/pwa-studio/node_modules/node-zopfli-es
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
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 PythonFinder.failNoPython (/home/rowan/src/pwa-studio/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/home/rowan/src/pwa-studio/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack     at F (/home/rowan/src/pwa-studio/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/home/rowan/src/pwa-studio/node_modules/which/which.js:80:29)
gyp ERR! stack     at /home/rowan/src/pwa-studio/node_modules/which/which.js:89:16
gyp ERR! stack     at /home/rowan/src/pwa-studio/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /home/rowan/src/pwa-studio/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:154:21)
gyp ERR! System Linux 4.18.0-1006-gcp
gyp ERR! command "/home/rowan/.nvm/versions/node/v10.15.1/bin/node" "/home/rowan/src/pwa-studio/node_modules/node-zopfli-es/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /home/rowan/src/pwa-studio/node_modules/node-zopfli-es

This adds in both Python and GCC as requirements for the development environment, as per https://github.com/nodejs/node-gyp#installation

I worry this complicates things for a lot of developers, is it possible to make this optional or perhaps drop in something like https://www.npmjs.com/package/wasm-zopfli instead? I'm not sure how stable that is, but it would remove the deps.

Specifically it looks like it's shrink-ray-current in upward-js/package.json that's pulling this in.

For anyone looking to get past this point on Ubuntu (and probably other Debian-based distros too) is:

sudo apt-get install python build-essential

Thanks for the detailed report, Henk. And thanks for adding those details, Rowan. I share your concerns, and I'll look into whether we can make some of these dependencies optional.

Hi,
I am also facing the same error with the provided development environment. Hope the fix will be released soon thanks.

@henktheunissen @syedsaleem086 @rowan-m

I've created #864 as a hopefully simple fix. Care to try it out on your machines?

This should be resolved after #864 was merged.

Was this page helpful?
0 / 5 - 0 ratings