remy / nodemon

Monitor for any changes in your node.js application and automatically restart the server - perfect for development
http://nodemon.io/
MIT License
26.23k stars 1.72k forks source link

Post-install step fails on Powershell #2061

Closed moritonal closed 2 years ago

moritonal commented 2 years ago

When trying to install nodemon on my Windows machine, I hit a weird problem I've seen elsewhere, the open-collective post-install hack fails.

Expected behaviour

I'd hope it'd install without crashing

Actual behaviour

It crashes brining the whole npm i process to a halt.

Steps to reproduce

npm i -g nodemon, but on my slightly odd Windows pseudo-powershell setup. I could go into the particulars, but the honest question is should nodemon require a post-install script? Especially given the project already supports npm fund?


npm ERR! code 1
npm ERR! path C:\Users\user\AppData\Roaming\npm\node_modules\nodemon
npm ERR! command failed
npm ERR! command powershell -c node bin/postinstall || exit 0
npm ERR! At line:1 char:22
npm ERR! + node bin/postinstall || exit 0
npm ERR! +                      ~~
npm ERR! The token '||' is not a valid statement separator in this version.
npm ERR!     + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
npm ERR!     + FullyQualifiedErrorId : InvalidEndOfLine

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\tmp\npm-cache\_logs\2022-09-01T09_46_16_321Z-debug-0.log
remy commented 2 years ago

npm fund does very very little, if anything.

I can't remember the last time I ran the command and I'd ask you the same question (or if you're even supporting nodemon).

So I'd rather find suggestions on how to silence or fix this error that happens in powershell (I'm not a Windows user so you'll need to help or wait for someone who is willing to).

moritonal commented 2 years ago

Damm, I'm glad you've managed to commercialise your success, but your response of "if you're even supporting nodemon" comes across pretty rough when it seems "support" means pay you to update a sponsor list?

The way I see it:

No worries, I've forked and can just use that, just thought I'd try help. The issue is valid and luckily the project is healthily supported so you can fix it on your time.

moritonal commented 2 years ago

This has also been a problem for years #2007, #1663, #1478, #1695.

remy commented 2 years ago

Glad you "fixed" it for yourself.

I originally wrote a long answer to your original longer comment, but it's not worth posting. You think what you want to think and ignore longevity of this project and the 12 years I've been maintaining it.

remy commented 2 years ago

Anyone coming along to this, there's a solution here: https://github.com/remy/nodemon/issues/1663#issuecomment-882045518