Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Installation instructions are wrong

Đang mở
#821 1 bình luận 9 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
45/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu với phần Installation được liên kết trong issue và tái hiện npm install gpu.js trên Ubuntu 22.04 với Node.js 19.9.0. Cập nhật hướng dẫn để bao quát các dependency cần thiết cho đường dẫn cài đặt đã được báo cáo, đồng thời xác minh rằng việc làm theo hướng dẫn sẽ hoàn tất quá trình cài đặt; các ý tưởng dài hạn về Python 3 và package được biên dịch sẵn thuộc phạm vi riêng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

What is wrong?

As per the installation instructions:

On Linux, ensure you have the correct header files installed: sudo apt install mesa-common-dev libxi-dev (adjust for your distribution)
(...)
npm install gpu.js --save

On Ubuntu 22.04, this is insufficient to actually install gpu.js. It produces a long error message, at the core of which is npm ERR! /bin/sh: 1: python: not found.

Complete error output: ``` npm ERR! code 1 npm ERR! path /++snip++/node_modules/gl npm ERR! command failed npm ERR! command sh -c prebuild-install || node-gyp rebuild npm ERR! prebuild-install warn install No prebuilt binaries found (target=19.9.0 runtime=node arch=x64 libc= platform=linux) npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using [email protected] npm ERR! gyp info using [email protected] | linux | x64 npm ERR! gyp info find Python using Python version 3.10.6 found at "/usr/bin/python3" npm ERR! gyp info spawn /usr/bin/python3 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/++snip++/node_modules/node-gyp/gyp/gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'make', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/++snip++/node_modules/gl/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/++snip++/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/++snip++/.cache/node-gyp/19.9.0/include/node/common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=/++snip++/.cache/node-gyp/19.9.0', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/++snip++/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/++snip++/.cache/node-gyp/19.9.0/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/++snip++/node_modules/gl', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! /bin/sh: 1: python: not found npm ERR! gyp: Call to 'python commit_id.py check ..' returned exit status 127 while in angle/src/angle.gyp. while loading dependencies of binding.gyp while trying to load binding.gyp npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1 npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/++snip++/node_modules/node-gyp/lib/configure.js:325:16) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28) npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12) npm ERR! gyp ERR! System Linux 5.19.0-45-generic npm ERR! gyp ERR! command "/usr/bin/node" "/++snip++/node_modules/.bin/node-gyp" "rebuild" npm ERR! gyp ERR! cwd /++snip++/node_modules/gl npm ERR! gyp ERR! node -v v19.9.0 npm ERR! gyp ERR! node-gyp -v v9.4.0 npm ERR! gyp ERR! not ok ```
## *Where* does it happen? When trying to `npm install` on Ubuntu 22.04.2 LTS, NodeJS 19.9.

How do we replicate the issue?

npm install gpu.js

How important is this (1-5)?

5

Expected behavior (i.e. solution)

Following the installation instructions should install gpu.js.

Other Comments

The issue is, at heart, the same as #814: gpu.js requires Python 2.7 to install, but this is not mentioned anywhere in the install instructions.

In addition, even after installing Python 2.7, the python command will be unrecognized on Ubuntu 22.04. I seem to remember reading that this is a system design decision, Canonical wanting developers to explicitly state the required version (i.e., python2 instead of python) to avoid version ambiguity, but can't find the source anymore. Either way, gpu.js doesn't adhere to that, so you need to manually symlink the python command to Python 2.

sudo apt install python2
sudo ln -s /bin/python2.7 /usr/bin/python

Proposed solution:

Short term fix: Update the docs, so that following the install instructions is actually sufficient to install gpu.js.
Long term fix: Update so that gpu.js can be installed using Python 3. Python 2 was sunset over three years ago, coupled with a strong recommendation to migrate to Python 3.

On a related note, it would be great if there was some way to install precompiled versions of gpu.js. This would remove the dependency on Python when shipping software, plus greatly speed up the process.

Ngôn ngữ chính
JavaScript
Star
15.5k
Fork
663
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của gpujs/gpu.js

Tất cả issue của gpujs/gpu.js

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.