Closed PatrikTrefil closed 1 year ago
Using winpty to run npm:
$ winpty npm --version
** winpty: error: cannot start 'npm': Not found in PATH **
x86_54
That's a funny CPU architecture you got there 😁
bash: /c/Users/patri/bin/npm: /usr/bin/env: bad interpreter: Permission denied
This suggests to me that there is a problem with the first line of C:\Users\Patri\bin\npm
. Can you investigate along those lines?
Yeah, that was supposed to be x86_64 of course 😁
$ cat -A /c/Users/patri/bin/npm
**
#!/usr/bin/env node$
require('../lib/cli.js')(process)$
**
I tried running this script.
#!/usr/bin/env node
console.log("hello world");
Everything worked fine.
Could be an issue with eols? Does /c/Users/patri/bin/npm
have crlf
line endings, while the other script is just lf
?
That's not it. The other script has the same line endings (lf
).
$ cat -A test
**
#!/usr/bin/env node$
console.log("hello world");$
**
Yeah, that was supposed to be x86_64 of course 😁
$ cat -A /c/Users/patri/bin/npm ** #!/usr/bin/env node$ require('../lib/cli.js')(process)$ **
I tried running this script.
#!/usr/bin/env node console.log("hello world");
Everything worked fine.
If I were you, I would insert a console.log()
into /c/Users/patri/bin/npm
to see whether the script is launched at all, and maybe the error occurs later. If it is not launched at all, I would then edit the second script by inserting that require()
call. Break it down, like.
Closing as stale.
Setup
Tried installing NodeJS using winget and default installer. Same with Git Bash
Details
mintty 3.5.2 (x86_54-pc-msys) [Windows 22000]
version of npm
bash: /c/Users/patri/bin/npm: /usr/bin/env: bad interpreter: Permission denied
-
Running node in Git Bash works fine.
Running the following command in Git Bash never exits, but in WSL Bash starts node.
Here is my $PATH given by Git Bash (might be relevant):