robbie-cahill / tunnelmole-client

Tunnelmole - Connect to local servers from anywhere
MIT License
1.29k stars 80 forks source link

npm i -g tunnelmole not working on windows #9

Closed RayyanNafees closed 1 year ago

RayyanNafees commented 1 year ago

Tried via pnpm

image

Tried via npm

image

is there any npx script available to run ? as in... pnpm dlx tmole or npx tmole

robbie-cahill commented 1 year ago

Looks like a permissions issue. Any way to run this in a terminal you opened as an Administrator?

RayyanNafees commented 1 year ago

Looks like a permissions issue. Any way to run this in a terminal you opened as an Administrator?

This is Admin Terminal... I tried chmod +x flags too but...

Alynntheyelloweyed commented 1 year ago

I'm having the same issues. Most of the permissions errors were really because those folders they were trying to rmdir didn't exist, so I slowly added those folders which eliminated all those errors, just leaving one


npm ERR! code 1
npm ERR! path F:\Local Documents\Documents\VisualStudioCodeProjects\FG Twitch Extension Server\node_modules\tunnelmole
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c cjs/bin/postinstall.js
npm ERR! 'cjs' is not recognized as an internal or external command,
npm ERR! operable program or batch file.

npm ERR! A complete log of this run can be found in: C:\Users\Alynn\AppData\Local\npm-cache\_logs\2023-06-04T16_20_46_971Z-debug-0.log```

tunneling is the last part of this section of this project
sk-tjdownes commented 1 year ago

Can confirm, broken on Windows 11, using nvm. Similar errors to above.

To me, it appears that the path to cjs is incorrect, even though it's definitely installed.

robbie-cahill commented 1 year ago

I wonder if its because of the script being like

"postinstall": "cjs/bin/postinstall.js"

That works fine on Linux (which I run as my main driver), because the script has this shebang at the top of it. I guess windows does not recognize that?

#!/usr/bin/env node

I've just published a new version which changes the script to explicitly invoke node.

"postinstall": "node cjs/bin/postinstall.js"

I don't have Windows installed to test however. Would one of you be able to test with the latest version 2.1.11?

https://github.com/robbie-cahill/tunnelmole-client/commit/8311e9c6f2e45b8af5c765f3878682fb10656249

sk-tjdownes commented 1 year ago

yup. that seems to resolve the issue. npm install -g tunnelmole works perfectly fine on Windows 11. Thanks for the fast resolution!

robbie-cahill commented 1 year ago

Excellent, i'll close the issue