close

[Solved] The token ‘&&’ is not a valid statement separator in this version

Hello Guys, How are you all? Hope You all Are Fine. Today I am installing Webpack on my React Project and the following error occurs The token ‘&&’ is not a valid statement separator in this version in Javasript. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How The token ‘&&’ is not a valid statement separator in this version Error Occurs ?

Today I am installing Webpack on my React Project. I am trying this command to install webpack.

npm run build && node ./dist/main.js

But he following problem hinders my progress:

+ npm run build && node ./dist/main.js
+               ~~
The token '&&' is not a valid statement separator in this version.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : InvalidEndOfLine

How To Solve The token ‘&&’ is not a valid statement separator in this version Error ?

  1. How To Solve The token '&&' is not a valid statement separator in this version Error ?

    To Solve The token '&&' is not a valid statement separator in this version If you are trying this command in powershell then you will face this error just try to run this command in CMD or git bash Or Just Use below command instead of you are trying Or This does not work in PowerShell on Windows so just split both commands and run them separately.

Solution 1: run this command in CMD or git bash

If you are trying this command in powershell then you will face this error just try to run this command in CMD or git bash

Solution 2: Try this

Just Use below command instead of you are trying

(npm run build) -and (node ./dist/main.js)

Solution 3:  just run them separetly

This does not work in PowerShell on Windows so just split both commands and run them separately:

npm run build
node ./dist/main.js

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also Read

Please Rate Our Solution to Motivate Us For Give Our Best

Leave a Comment