degit
degit copied to clipboard
npx degit failed due to missing #!/usr/bin/env node line
npx degit https://github.com/xyteam/autobdd-test.git#main autobdd-test
npx: installed 1 in 0.681s
/home/xywang68/.npm/_npx/805/bin/degit: 1: use strict: not found
/home/xywang68/.npm/_npx/805/bin/degit: 3: Syntax error: "(" unexpected
npm install degit and npm install degit and added line:
#!/usr/bin/env node
to bin/degit solve the problem.
faced the same issue solved it exactly as @xywang68 mentioned.
Giving a bit more context:
Stumbled upon similar issue: https://github.com/domenic/worm-scraper/issues/5#issuecomment-321033496
Stack overflow answer https://stackoverflow.com/a/34354713
the same problem happened to me
Install degit npm install -g degit
Edit degit, add this line #!/usr/bin/env node
at the top of the file
nano /usr/local/bin/degit
I'm also getting the same issue. I did the same thing @nashaad did and it works for me.
Had the same issue today (was working fine two days ago). I noticed I was not using the latest npx version, so I upgraded npm 7.7.6.
As proposed above, I edited degit script and added the following line at the top of the file:
#!/usr/bin/env node
It fixed the issue. I'm on ubuntu 20.04.
Yeah I was teaching a class which I guess was 30 minutes after the update and had the same issue with all my students. Turned it into an impromptu lesson on reading github issues (then they just cloned the starter code). Sounds like a quick fix so hopefully the Saturday class will go smoother :).
@Rich-Harris Thank you for quick fixes!
- https://github.com/Rich-Harris/degit/commit/07222570613a5326db11269c2f8dc0324add765f#diff-f9469b2caca44d79b8f2f7c81296a7b2bf9b19e25fb3e1450b9f4f3bf4117e2b
- https://github.com/Rich-Harris/degit/commit/64b80577acf3313b669840f7452800ee8d09fbf3#diff-f9469b2caca44d79b8f2f7c81296a7b2bf9b19e25fb3e1450b9f4f3bf4117e2b
Now v2.8.4 works fine 🎉
YES, Thank you!