令牌“&&"在此版本中不是有效的语句分隔符 [英] The token '&&' is not a valid statement separator in this version

查看:13
本文介绍了令牌“&&"在此版本中不是有效的语句分隔符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 React 项目中安装 Webpack 的过程中,以下问题阻碍了我的进度:

On the way of installing Webpack on my React Project, the following problem hinders my progress:

最后一步配置 Webpack

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

Windows Power Shell/Visual Studio Code 上的错误

PS C:UserspythonbuddhaDesktop	o_experiment	o-do-list> npm run build && node ./dist/main.js
At line:1 char:15
+ npm run build && node ./dist/main.js
+               ~~
The token '&&' is not a valid statement separator in this version.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : InvalidEndOfLine

承诺配置 webpack 的教程

https://developerhandbook.com/webpack/webpack-4-from-absolute-scratch/

https://developerhandbook.com/webpack/how-to-configure-scss-modules-for-webpack/

推荐答案

因为你在 PowerShell 中,请尝试在 CMDGit Bash

It's because you're in PowerShell, try running it in CMD or Git Bash

或者(如果你想继续在 PS 中):

Alternatively (if you wish to continue in PS):

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

第三种选择,单独运行它们,

3rd Alternative, just run them separetly,

这篇关于令牌“&&"在此版本中不是有效的语句分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆