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

NPM package requirement does not work on windows #241

Open
OlivierPonant opened this issue Feb 15, 2024 · 3 comments
Open

NPM package requirement does not work on windows #241

OlivierPonant opened this issue Feb 15, 2024 · 3 comments

Comments

@OlivierPonant
Copy link

Issue type

Bug

How did you install PythonMonkey?

Installed from pip

OS platform and distribution

Windows 10

Python version (python --version)

3.10.2

PythonMonkey version (pip show pythonmonkey)

0.3.0

Bug Description

PythonMonkey is not able to require NPM package which requires another npm package.

Standalone code to reproduce the issue

It can be reproduce easily by launching the example on your repo : https://github.com/Distributive-Network/pythonmonkey-examples/tree/main/require-npm-package-from-py

Relevant log output or backtrace

(venv) PS C:\Users\olivierc\Documents\Repositories\pythonmonkey-examples> python .\require-npm-package-from-py\main.py
Traceback (most recent call last):
  File "C:\Users\olivierc\Documents\Repositories\pythonmonkey-examples\require-npm-package-from-py\main.py", line 11, in <module>
  File "C:\Users\olivierc\Documents\Repositories\pythonmonkey-examples\venv\lib\site-packages\pythonmonkey\require.py", line 353, in require
pythonmonkey.SpiderMonkeyError: Error in file C:\Users\olivierc\Documents\Repositories\pythonmonkey-examples\venv\lib\site-packages\pythonmonkey\node_modules/ctx-modError: module not found -- require('is-number') from C:/Users/olivierc/Documents/Repositories/pythonmonkey-examples/require-npm-package-from-py/node_modules/is-odd/index.js

Additional info if applicable

We tested it on 2 windows (10 and 11) and it does not work but on Linux Ubuntu, it worked like a charm !

What branch of PythonMonkey were you developing on? (If applicable)

No response

@wiwichips
Copy link
Collaborator

@OlivierPonant , thanks for filing this issue - the PythonMonkey team will look into this


@philippedistributive @Xmader @caleb-distributive , here is the repro: https://github.com/Distributive-Network/pythonmonkey-examples/tree/main/require-npm-package-from-py <-- give it a shot on Windows

@wesgarland
Copy link
Collaborator

This is likely a bug in the npm ctx-module package. I'm going to need to get access to a Windows box to debug this properly. Anybody have one I can SSH into? :)

@wesgarland
Copy link
Collaborator

wesgarland commented Mar 15, 2024

This is most likely issue #292

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

No branches or pull requests

3 participants