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

Missing npm should print better error during pip install #116

Closed
wesgarland opened this issue Jul 17, 2023 · 2 comments · May be fixed by #129
Closed

Missing npm should print better error during pip install #116

wesgarland opened this issue Jul 17, 2023 · 2 comments · May be fixed by #129

Comments

@wesgarland
Copy link
Collaborator

Collecting pminit
  Downloading https://nightly.pythonmonkey.io/pminit/pminit-0.0.1.dev1032%2Bb9fb965.tar.gz (6.9 kB)
  Running command pip subprocess to install build dependencies
  Looking in indexes: https://pypi.org/simple, https://nightly.pythonmonkey.io/
  Collecting poetry-core>=1.0.0
    Using cached poetry_core-1.6.1-py3-none-any.whl (450 kB)
  Collecting poetry-dynamic-versioning==0.24.0
    Downloading poetry_dynamic_versioning-0.24.0-py3-none-any.whl (16 kB)
  Collecting dunamai<2.0.0,>=1.17.0
    Downloading dunamai-1.18.0-py3-none-any.whl (24 kB)
  Collecting jinja2<4,>=2.11.1
    Downloading Jinja2-3.1.2-py3-none-any.whl (133 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.1/133.1 kB 5.0 MB/s eta 0:00:00
  Collecting tomlkit>=0.4
    Using cached tomlkit-0.11.8-py3-none-any.whl (35 kB)
  Collecting packaging>=20.9
    Using cached packaging-23.1-py3-none-any.whl (48 kB)
  Collecting MarkupSafe>=2.0
    Downloading MarkupSafe-2.1.3-cp311-cp311-macosx_10_9_x86_64.whl (13 kB)
  Installing collected packages: tomlkit, poetry-core, packaging, MarkupSafe, jinja2, dunamai, poetry-dynamic-versioning
  Successfully installed MarkupSafe-2.1.3 dunamai-1.18.0 jinja2-3.1.2 packaging-23.1 poetry-core-1.6.1 poetry-dynamic-versioning-0.24.0 tomlkit-0.11.8

  [notice] A new release of pip is available: 23.0.1 -> 23.2
  [notice] To update, run: python3.11 -m pip install --upgrade pip
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  Getting requirements to build wheel ... done
  Running command Preparing metadata (pyproject.toml)
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pminit
  Running command Building wheel for pminit (pyproject.toml)
  /bin/sh: npm: command not found
  Traceback (most recent call last):
    File "/private/var/folders/64/b8cgz6zx1sx62yr5kwql813c0000gn/T/pip-install-gmtdwgke/pminit_54b7ddf7e3eb417192a5aa3ca67a62ce/post-install-hook.py", line 20, in <module>
      main()
    File "/private/var/folders/64/b8cgz6zx1sx62yr5kwql813c0000gn/T/pip-install-gmtdwgke/pminit_54b7ddf7e3eb417192a5aa3ca67a62ce/post-install-hook.py", line 17, in main
      execute("cd pythonmonkey && npm i --no-package-lock") # do not update package-lock.json
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/64/b8cgz6zx1sx62yr5kwql813c0000gn/T/pip-install-gmtdwgke/pminit_54b7ddf7e3eb417192a5aa3ca67a62ce/post-install-hook.py", line 14, in execute
      raise subprocess.CalledProcessError(return_code, cmd)
  subprocess.CalledProcessError: Command 'cd pythonmonkey && npm i --no-package-lock' returned non-zero exit status 127.
  Traceback (most recent call last):
    File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/64/b8cgz6zx1sx62yr5kwql813c0000gn/T/pip-build-env-vj7xz744/overlay/lib/python3.11/site-packages/poetry/core/masonry/api.py", line 57, in build_wheel
      return WheelBuilder.make_in(
             ^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/64/b8cgz6zx1sx62yr5kwql813c0000gn/T/pip-build-env-vj7xz744/overlay/lib/python3.11/site-packages/poetry/core/masonry/builders/wheel.py", line 88, in make_in
      wb.build(target_dir=directory)
    File "/private/var/folders/64/b8cgz6zx1sx62yr5kwql813c0000gn/T/pip-build-env-vj7xz744/overlay/lib/python3.11/site-packages/poetry/core/masonry/builders/wheel.py", line 123, in build
      self._build(zip_file)
    File "/private/var/folders/64/b8cgz6zx1sx62yr5kwql813c0000gn/T/pip-build-env-vj7xz744/overlay/lib/python3.11/site-packages/poetry/core/masonry/builders/wheel.py", line 172, in _build
      self._run_build_script(self._package.build_script)
    File "/private/var/folders/64/b8cgz6zx1sx62yr5kwql813c0000gn/T/pip-build-env-vj7xz744/overlay/lib/python3.11/site-packages/poetry/core/masonry/builders/wheel.py", line 232, in _run_build_script
      subprocess.check_call([self.executable.as_posix(), build_script])
    File "/usr/local/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 413, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['/usr/local/Cellar/[email protected]/3.11.4_1/bin/python3.11', 'post-install-hook.py']' returned non-zero exit status 1.
  error: subprocess-exited-with-error
  
  × Building wheel for pminit (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /usr/local/opt/[email protected]/bin/python3.11 /usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /var/folders/64/b8cgz6zx1sx62yr5kwql813c0000gn/T/tmpzxvllrjp
  cwd: /private/var/folders/64/b8cgz6zx1sx62yr5kwql813c0000gn/T/pip-install-gmtdwgke/pminit_54b7ddf7e3eb417192a5aa3ca67a62ce
  Building wheel for pminit (pyproject.toml) ... error
  ERROR: Failed building wheel for pminit
Failed to build pminit
ERROR: Could not build wheels for pminit, which is required to install pyproject.toml-based projects

[notice] A new release of pip is available: 23.0.1 -> 23.2
[notice] To update, run: python3.11 -m pip install --upgrade pip
[~] Wes-iMac-2019:wes# ```
@Xmader
Copy link
Member

Xmader commented Jul 17, 2023

The error is

/bin/sh: npm: command not found

npm (Node.js) is required to install packages in node_modules. I'm thinking we could bring our own minimum npm.py to install those packages.

@Xmader
Copy link
Member

Xmader commented Aug 3, 2023

Closed by #152

@Xmader Xmader closed this as completed Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants