Skip to content

Commit 4924813

Browse files
Ensure proper uninstallation of n
Make sure the path correctly references `npm`, `npx`, and `node` Signed-off-by: Param Siddharth <[email protected]>
1 parent 80624a6 commit 4924813

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/test.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,22 @@ jobs:
1919

2020
# Revert the NodeJS version in order to use the system one instead (needed due to libnode)
2121
- name: Delete latest version of NodeJS
22-
run: yes | sudo n uninstall
22+
run: |
23+
yes | sudo n uninstall
24+
# Source: https://github.com/tj/n/issues/540#issuecomment-443844202
25+
sudo rm -f "/usr/local/bin/node"
26+
sudo rm -f "/usr/local/bin/npm"
27+
sudo rm -f "/usr/local/bin/npx"
28+
sudo rm -rf "/usr/local/include/node"
29+
sudo rm -rf "/usr/local/lib/dtrace/node.d"
30+
sudo rm -rf "/usr/local/lib/node_modules/npm"
31+
sudo rm -rf "/usr/local/share/doc/node"
32+
sudo rm -rf "/usr/local/share/man/man1/node.1"
33+
sudo rm -rf "/usr/local/share/systemtap/tapset/node.stp"
34+
# Creating a symbolic link to bypass path reference bug
35+
sudo ln -s /usr/bin/node /usr/local/bin/node
36+
sudo ln -s /usr/bin/npm /usr/local/bin/npm
37+
sudo ln -s /usr/bin/npx /usr/local/bin/npx
2338

2439
- name: Set up the environment
2540
run: sudo ./tools/metacall-environment.sh $METACALL_INSTALL_OPTIONS

0 commit comments

Comments
 (0)