Skip to content

Allow system npm in "emsdk install emscripten"#723

Merged
sbc100 merged 2 commits into
emscripten-core:masterfrom
truboxl:patch-1
Feb 23, 2021
Merged

Allow system npm in "emsdk install emscripten"#723
sbc100 merged 2 commits into
emscripten-core:masterfrom
truboxl:patch-1

Conversation

@truboxl
Copy link
Copy Markdown
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
Comment thread 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
Copy Markdown
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
Copy Markdown
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