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

Allow system npm in "emsdk install emscripten" #723

Merged
merged 2 commits into from
Feb 23, 2021

Conversation

truboxl
Copy link
Contributor

@truboxl truboxl commented Feb 21, 2021

"emsdk install emscripten-master-64bit" is currently dependent on whether emscripten node is installed or not.

This change allow using system-provided node / npm command to proceed the installation. Also clarify the error message.

Other alternatives:
#640 maybe addresses this for a different reason
I don't think #714 addresses this
Another alternative is to provide node.js in source form (and compile it) if "emsdk install emscripten" must use emscripten node / npm, to which also can address #623

@truboxl truboxl marked this pull request as draft February 21, 2021 07:30
@truboxl truboxl marked this pull request as ready for review February 21, 2021 08:09
@truboxl truboxl marked this pull request as draft February 21, 2021 09:51
"emsdk install emscripten-master-64bit" is currently dependent on
whether emscripten node is installed or not.

This change allow using system-provided node / npm command to proceed
the installation. Also clarify the error message.
@truboxl truboxl marked this pull request as ready for review February 22, 2021 09:34
emsdk.py Outdated
try:
subprocess.check_output(['npm' + ('.cmd' if WINDOWS else ''), '--version'], stderr=subprocess.STDOUT, universal_newlines=True)
node_path = os.path.dirname(shutil.which('npm' + ('.cmd' if WINDOWS else '')))
except subprocess.CalledProcessError:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a local which function in this file which you can use rather than shtuil.which (since we want to support python2).

You don't need the try/catch then either. You an just do 'node_path = which ...and thenif not node_path`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@sbc100 sbc100 merged commit 63b6cd2 into emscripten-core:master Feb 23, 2021
@truboxl truboxl deleted the patch-1 branch February 24, 2021 02:37
akoeplinger pushed a commit to akoeplinger/emsdk that referenced this pull request Dec 13, 2024
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

Successfully merging this pull request may close these issues.

2 participants