Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Build fails with Python 3 due to old node-gyp version requirement #670

Closed
ghost opened this issue Oct 12, 2020 · 1 comment
Closed

Build fails with Python 3 due to old node-gyp version requirement #670

ghost opened this issue Oct 12, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Oct 12, 2020

Describe the Bug

"npm install" command fails when Python 3 is used by NPM because node-gyp package version requirement in package-lock.json is 3.8.0 which does not support Python 3 per the recent comments on nodejs/node-gyp#1337

Steps To Reproduce

  1. Install a version of Python 3 on the system
  2. git clone https://github.com/bitwarden/web.git web-vault
  3. cd web-vault
  4. npm install
  5. Observe the error message

Expected Result

npm install completes successfully.

Actual Result

npm install fails.

Screenshots or Videos

> node-sass@4.13.1 install /rw/root/web-vault/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.1/freebsd-x64-83_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.13.1/freebsd-x64-83_binding.node": 

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g. 

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> node-sass@4.13.1 postinstall /rw/root/web-vault/node_modules/node-sass
> node scripts/build.js

Building: /rw/usr/local/bin/node /rw/root/web-vault/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   '/rw/usr/local/bin/node',
gyp verb cli   '/rw/root/web-vault/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@14.13.0 | freebsd | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "/usr/local/bin/python3.7" in the PATH
gyp verb `which` succeeded /usr/local/bin/python3.7 /usr/local/bin/python3.7
gyp ERR! configure error 
gyp ERR! stack Error: Command failed: /usr/local/bin/python3.7 -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", 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:308:12)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at maybeClose (internal/child_process.js:1047:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:438:11)
gyp ERR! stack     at Socket.emit (events.js:314:20)
gyp ERR! stack     at Pipe.<anonymous> (net.js:672:12)
gyp ERR! System FreeBSD 12.1-RELEASE-p9
gyp ERR! command "/rw/usr/local/bin/node" "/rw/root/web-vault/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /rw/root/web-vault/node_modules/node-sass
gyp ERR! node -v v14.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm WARN @angular/animations@9.1.12 requires a peer of tslib@^1.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/cdk@9.2.4 requires a peer of tslib@^1.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/common@9.1.12 requires a peer of tslib@^1.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/compiler@9.1.12 requires a peer of tslib@^1.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/compiler-cli@9.1.12 requires a peer of tslib@^1.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/core@9.1.12 requires a peer of tslib@^1.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/forms@9.1.12 requires a peer of tslib@^1.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/platform-browser@9.1.12 requires a peer of tslib@^1.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/platform-browser-dynamic@9.1.12 requires a peer of tslib@^1.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/router@9.1.12 requires a peer of tslib@^1.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular2-toaster@8.0.0 requires a peer of @angular/common@^8.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular2-toaster@8.0.0 requires a peer of @angular/compiler@^8.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular2-toaster@8.0.0 requires a peer of @angular/core@^8.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angulartics2@9.1.0 requires a peer of tslib@^1.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.3.1 requires a peer of popper.js@^1.14.7 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"freebsd","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/webpack-dev-server/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"freebsd","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/watchpack/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"freebsd","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/glob-watcher/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"freebsd","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.13.1 postinstall 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/2020-10-12T21_49_41_399Z-debug.log

Environment

  • Operating system: FreeBSD 12.1-RELEASE
  • Browser: N/A
  • Build Version (Bottom of the page): [2.16.1]

Additional Context

Installing Python 2.7 on the system, executing npm config set python python2.7, and then running npm install again works to make the build finish successfully.

@djsmith85
Copy link
Contributor

Hi @Barracuda6 thank you for your detailed report. With us recently replacing node-sass (which was deprecated) in favor of sass, this issue shouldn't come up anymore. sassdoes not rely onnode-gyp`, hence no need to compile it with python.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant