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

node-sass binary not found by new nodejs, can't build due to node-gyp py2.7 dep #795

Closed
milindsmart opened this issue May 5, 2021 · 7 comments

Comments

@milindsmart
Copy link
Contributor

milindsmart commented May 5, 2021

Recently tried to install GP again on a new PC, ran into errors with UI duringnpm install:

  • Trying to retrieve the node-sass binary fails:
> node-sass@4.12.0 install D:\gridpath-main-1\ui\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.12.0/win32-x64-83_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.12.0/win32-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
 

I think, but am not sure, that the fix is to specify the version of nodejs that GridPath UI is compatible with.

@anamileva
Copy link
Member

I can't reproduce this. My current setup on Windows is Node.js v14.15, FYI. Are you perhaps using an oldish version of npm? I would suggest upgrading if so since this type of installation issues are often npm-related. On Windows, my npm version is v7.6.3 (I need to upgrade to the latest also).

@milindsmart
Copy link
Contributor Author

milindsmart commented May 7, 2021

This is on node 14.8.0 and npm 6.14.7. Single command to reproduce in this machine was npm install node-sass@4.12.0. The log is pasted below. Could you try the same? We could then determine if the problem doesn't occur because, for example, a different version is used.

Will try upgrading from npm 6 to npm 7 and see, meanwhile.

(gridpath) D:\>npm install node-sass@4.12.0

> node-sass@4.12.0 install D:\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.12.0/win32-x64-83_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.12.0/win32-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.12.0 postinstall D:\node_modules\node-sass
> node scripts/build.js

Building: C:\Users\hp\anaconda3\envs\gridpath\node.exe D:\node_modules\node-sass\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   'C:\\Users\\hp\\anaconda3\\envs\\gridpath\\node.exe',
gyp verb cli   'D:\\node_modules\\node-sass\\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.8.0 | win32 | 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 (D:\node_modules\node-sass\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\node_modules\node-sass\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\node_modules\node-sass\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\node_modules\node-sass\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:176:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (D:\node_modules\node-sass\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\node_modules\node-sass\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\node_modules\node-sass\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\node_modules\node-sass\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:176: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 C:\Users\hp\anaconda3\envs\gridpath\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\hp\anaconda3\envs\gridpath\python.EXE -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:1051:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\\Users\\hp\\anaconda3\\envs\\gridpath\\node.exe" "D:\\node_modules\\node-sass\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\node_modules\node-sass
gyp ERR! node -v v14.8.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN enoent ENOENT: no such file or directory, open 'D:\package.json'
npm WARN !invalid#1 No description
npm WARN !invalid#1 No repository field.
npm WARN !invalid#1 No README data
npm WARN !invalid#1 No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.12.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.12.0 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!     C:\Users\hp\AppData\Roaming\npm-cache\_logs\2021-05-07T12_04_40_648Z-debug.log

@anamileva
Copy link
Member

@milindsmart, yes, I can reproduce the error by directly trying to install node-sass@4.12.0. However, note that node-sass@4.12.0 is an optional dependency for @angular-devkit/build-angular, so it does seem to get skipped over during install and is not causing an issue for me with Node.js v14.15, npm v7.6.3, and GridPath v0.9.0. Please let me know if you're still seeing the problem after upgrading node, npm, and gridpath.

@milindsmart
Copy link
Contributor Author

Updating npm to 6.14.13 resulted in success, see below. Node-sass install fails, then the build fails, but the overall install proceeds anyway. Once I verify the built GUI runs and is fully functional, we can close this issue.

Would it be possible to indicate/enforce a minimum node/npm version for GridPath?

npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
> node-sass@4.12.0 install D:\gridpath-main\ui\node_modules\node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.12.0/win32-x64-83_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.12.0/win32-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
> core-js@2.6.9 postinstall D:\gridpath-main\ui\node_modules\core-js
> node scripts/postinstall || echo "ignore"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> node-sass@4.12.0 postinstall D:\gridpath-main\ui\node_modules\node-sass
> node scripts/build.js
Building: C:\Users\hp\anaconda3\envs\gridpath\node.exe D:\gridpath-main\ui\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   'C:\\Users\\hp\\anaconda3\\envs\\gridpath\\node.exe',
gyp verb cli   'D:\\gridpath-main\\ui\\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.8.0 | win32 | 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 (D:\gridpath-main\ui\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\gridpath-main\ui\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\gridpath-main\ui\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\gridpath-main\ui\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\gridpath-main\ui\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\gridpath-main\ui\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:176:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (D:\gridpath-main\ui\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\gridpath-main\ui\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\gridpath-main\ui\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\gridpath-main\ui\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\gridpath-main\ui\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\gridpath-main\ui\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:176: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 C:\Users\hp\anaconda3\envs\gridpath\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\hp\anaconda3\envs\gridpath\python.EXE -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:1051:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:442:11)
gyp ERR! stack     at Socket.emit (events.js:314:20)
gyp ERR! stack     at Pipe.<anonymous> (net.js:673:12)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\\Users\\hp\\anaconda3\\envs\\gridpath\\node.exe" "D:\\gridpath-main\\ui\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\gridpath-main\ui\node_modules\node-sass
gyp ERR! node -v v14.8.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
> electron@5.0.4 postinstall D:\gridpath-main\ui\node_modules\electron
> node install.js

> gridpath-ui@0.9.0 postinstall D:\gridpath-main\ui
> electron-builder install-app-deps
  • electron-builder version=20.44.4
  • no native production dependencies
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.12.0 (node_modules\node-sass):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.12.0 postinstall: `node scripts/build.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
added 1275 packages from 1134 contributors and audited 1384 packages in 509.701s
found 1967 vulnerabilities (1843 low, 50 moderate, 73 high, 1 critical)
  run `npm audit fix` to fix them, or `npm audit` for details

@anamileva
Copy link
Member

Thanks, @milindsmart. Yes, it makes sense to me to add a brief note on the node and npm version requirements to the README file under the ui folder, probably adding an npm section under the NodeJS section. I can do that as part of the next release (coming soon) and of course you are welcome to pull request something in. (Note that the last time you contributed, your commit didn't seem to be recognized as coming from your GitHub user, probably because of a mismatched email address, so look into this to get the contribution credit on GitHub.)

@milindsmart
Copy link
Contributor Author

Ok confirmed that the GUI built after the npm version upgrade works properly.

Since @angular-devkit/build-angular is the one specifying a version of node-sass that's incompatible with later versions of nodejs, is it possible to bump up the version of @angular-devkit/build-angular in package.json from 0.13.0? I'm not yet comfortable enough with the nodejs ecosystem to contribute though...

Thanks for the tip on the contribution credit, it was indeed a mismatched email address, fixed now.

@anamileva
Copy link
Member

is it possible to bump up the version of @angular-devkit/build-angular in package.json from 0.13.0

Yes, you could try, but it may create other incompatibility issues. It's a bit of a chore updating dependencies, so reserving some time is usually required for that maintenance work.

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