Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependencies cannot be installed. #68

Closed
Pik-9 opened this issue Feb 6, 2021 · 4 comments
Closed

Dependencies cannot be installed. #68

Pik-9 opened this issue Feb 6, 2021 · 4 comments

Comments

@Pik-9
Copy link

Pik-9 commented Feb 6, 2021

Expected Behavior

After cloning the repository, I tried to install the dependencies with:

npm ci

Current Behavior

But I got an error installing node-sass:

> [email protected] install /mnt/Daten/tmp/node/materialize/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-88_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-88_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

> [email protected] postinstall /mnt/Daten/tmp/node/materialize/node_modules/node-sass
> node scripts/build.js

Building: /usr/bin/node /mnt/Daten/tmp/node/materialize/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   '/usr/bin/node',
gyp verb cli   '/mnt/Daten/tmp/node/materialize/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 [email protected]
gyp info using [email protected] | linux | 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 "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/mnt/Daten/tmp/node/materialize/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/mnt/Daten/tmp/node/materialize/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/mnt/Daten/tmp/node/materialize/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /mnt/Daten/tmp/node/materialize/node_modules/which/which.js:89:16
gyp verb `which` failed     at /mnt/Daten/tmp/node/materialize/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /mnt/Daten/tmp/node/materialize/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:196:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/mnt/Daten/tmp/node/materialize/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/mnt/Daten/tmp/node/materialize/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/mnt/Daten/tmp/node/materialize/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /mnt/Daten/tmp/node/materialize/node_modules/which/which.js:89:16
gyp verb `which` failed     at /mnt/Daten/tmp/node/materialize/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /mnt/Daten/tmp/node/materialize/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:196:21) {
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python /usr/bin/python
gyp ERR! configure error 
gyp ERR! stack Error: Command failed: /usr/bin/python -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 (node:child_process:327:12)
gyp ERR! stack     at ChildProcess.emit (node:events:378:20)
gyp ERR! stack     at maybeClose (node:internal/child_process:1067:16)
gyp ERR! stack     at Socket.<anonymous> (node:internal/child_process:453:11)
gyp ERR! stack     at Socket.emit (node:events:378:20)
gyp ERR! stack     at Pipe.<anonymous> (node:net:665:12)
gyp ERR! System Linux 5.10.13-hardened1-1-hardened
gyp ERR! command "/usr/bin/node" "/mnt/Daten/tmp/node/materialize/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /mnt/Daten/tmp/node/materialize/node_modules/node-sass
gyp ERR! node -v v15.8.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Possible Solution

It looks like some scripts are depending on the discontinued version 2 of python.
I'm not sure whether newer versions of node-sass are updated to version 3, yet. If so, one might want to update that dependency.

Your Environment

$ python --version
Python 3.9.1

$ npm --version
6.14.11

$ node --version
v15.8.0

$ git branch --show-current
v1-dev

$ git rev-parse --verify HEAD
a748515b0cd0a6ca2d018cd0458d292c40e18d9c

Regards
🂩

@Pik-9
Copy link
Author

Pik-9 commented Feb 6, 2021

Since the developers of node-sass seem to be unwilling to do anything about this, a move to Dart Sass should be considered. It's even recommended by the developers themselves:

Warning: LibSass and Node Sass are deprecated. While they will continue to receive maintenance releases indefinitely, there are no plans to add additional features or compatibility with any new CSS or Sass features. Projects that still use it should move onto Dart Sass.

Regards
🂩

@DanielRuf
Copy link

This is probably an issue with the bundled node-gyp version (3.8).

You might want to install a newer release of node-gyp.

https://github.com/nodejs/node-gyp#installation

https://github.com/nodejs/node-gyp/releases

@Pik-9
Copy link
Author

Pik-9 commented Feb 9, 2021

Hi @DanielRuf,

unfortunately installing the latest version of node-gyp does not fix the problem, since npm i insists on using the version 3.8, because it is the dependency of a dependency.
I tried npm install -g node-gyp@latest, but it still used version 3.8.

I think this is the core of the problem: materialize has some really old dependencies, which have long been deprecated.
Correct me, if I missed something.

Regards
🂩

@DanielRuf
Copy link

Did you try npm i or npm ci? The second uses the lockfile. So if there is somewhere node-gyp in the lockfile, yes that makes sense. It should work with npm i.

Try to rebuild node-sass with npm. At least I had no issues with node-sass on current Node versions, even if it is not prebuilt.

As this is an issue with node-sass and not materialize itself it makes more sense to report the issue in the node-sass repo.

Migrating to another dependency as alternative will not happen in the near future.

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

No branches or pull requests

2 participants