The token '||' is not a valid statement separator in this version.
See original GitHub issuenodemon -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
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
The token '&&' is not a valid statement separator in this version
I found that within PowerShell as my terminal within VS Code , replacing && in the command with ; did the trick.
Read more >The token '||' is not a valid statement separator in this version ...
nodemon isn't installing on my project. Operating system/terminal environment (powershell):; Versions: latest; Command you ran: npm install ...
Read more >The token '&&' is not a valid statement separator in this version
The token '&&' is not a valid statement separator in this version | Visual Studio error. 8.5K views 1 year ago. Ajay Kumbhar....
Read more >The token '&&' is not a valid statement separator in this version
Solution to fixing The Token '&&' is not a valid statement separator error seen in the Visual Studio Code terminal and Angular CLI....
Read more >The token '&&' is not a valid statement separator in this version ...
[Solved]-The token '&&' is not a valid statement separator in this version-Reactjs · score:53. Accepted answer · score:2. I have solved the issue...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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.