nodemon: The token '||' is not a valid statement separator in this version.
nodemon -v: Can’t install (i’m doing locally)node -v: 12.10.0- Operating system/terminal environment: Window 10
- Using Docker? What image: None
- Command you ran: npm i nodemon --save-dev
Expected behaviour
Install correctly
Actual behaviour
node bin/postinstall || exit 0
`At line:1 char:22
- node bin/postinstall || exit 0
-
~~
The token ‘||’ is not a valid statement separator in this version. + CategoryInfo : ParserError: (😃 [], ParentContainsErrorRecordException + FullyQualifiedErrorId : InvalidEndOfLine`
Steps to reproduce
- Create empty folder
- Run
npm initwith all default value - Run
npm i nodemon--save-dev
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (6 by maintainers)
Hi all, I managed to fix it sort of, run the following commands in order,
and for anyone trying to replicate the problem, run,
npm config set script-shell powershellbeforenpm i nodemonhope it help!I have been having this issue as well. I’m ussing powershell 6 (also tried with powershell 5.1 and got the same result).
As OP mentions, this is what I’ve done:
I have previously used nodemon (a month ago probably) in another project through this exact same install command and everything worked fine. Now, in that project, deleting the node_modules folder and running npm install yields the same output as above. It seems there’s something wrong with the command node bin/postinstall || exit 0 ‘||’ is not a powershell operator.
I’m glad to give any more details if needed.