node plugin: dont crash when running on non-snap arm64 env
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
-----
When building nodejs based snap in a docker container using snapcraft 8.4.3 the build fails with these logs
```
2024-10-19 13:36:25.195 Architecture "aarch64 ('64bit', '')" is not supported.
2024-10-19 13:36:25.199 Traceback (most recent call last):
2024-10-19 13:36:25.199 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/plugins/npm_plugin.py", line 151, in _get_architecture
2024-10-19 13:36:25.199 node_arch = _NODE_ARCH_FROM_PLATFORM[machine_type][architecture_type[0]]
2024-10-19 13:36:25.200 KeyError: 'aarch64'
2024-10-19 13:36:25.200
2024-10-19 13:36:25.200 The above exception was the direct cause of the following exception:
2024-10-19 13:36:25.200 Traceback (most recent call last):
2024-10-19 13:36:25.200 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_application/services/lifecycle.py", line 270, in run
2024-10-19 13:36:25.201 aex.execute(action, stdout=stream, stderr=stream)
2024-10-19 13:36:25.201 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/executor/executor.py", line 324, in execute
2024-10-19 13:36:25.201 self._executor.execute(actions, stdout=stdout, stderr=stderr)
2024-10-19 13:36:25.201 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/executor/executor.py", line 136, in execute
2024-10-19 13:36:25.201 self._run_action(act, stdout=stdout, stderr=stderr)
2024-10-19 13:36:25.201 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/executor/executor.py", line 211, in _run_action
2024-10-19 13:36:25.202 handler.run_action(action, stdout=stdout, stderr=stderr)
2024-10-19 13:36:25.202 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/executor/part_handler.py", line 171, in run_action
2024-10-19 13:36:25.202 state = handler(step_info, stdout=stdout, stderr=stderr)
2024-10-19 13:36:25.202 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/executor/part_handler.py", line 310, in _run_build
2024-10-19 13:36:25.202 self._run_step(
2024-10-19 13:36:25.202 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/executor/part_handler.py", line 493, in _run_step
2024-10-19 13:36:25.203 return step_handler.run_builtin()
2024-10-19 13:36:25.203 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/executor/step_handler.py", line 108, in run_builtin
2024-10-19 13:36:25.203 return handler()
2024-10-19 13:36:25.203 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/executor/step_handler.py", line 138, in _builtin_build
2024-10-19 13:36:25.203 build_commands = self._plugin.get_build_commands()
2024-10-19 13:36:25.204 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/plugins/npm_plugin.py", line 277, in get_build_commands
2024-10-19 13:36:25.204 arch = self._get_architecture()
2024-10-19 13:36:25.204 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/plugins/npm_plugin.py", line 153, in _get_architecture
2024-10-19 13:36:25.204 raise InvalidArchitecture(
2024-10-19 13:36:25.204 craft_parts.errors.InvalidArchitecture: Architecture "aarch64 ('64bit', '')" is not supported.
2024-10-19 13:36:25.204 Make sure the architecture name is correct.
2024-10-19 13:36:25.205 Recommended resolution: Make sure the architecture name is correct.
```
Evaluation history
No evaluation history available.