Rails npm 运行 正在观看 npm 错误!缺少脚本:"watching"

Rails npm run watching npm ERR! Missing script: "watching"

我下载了(git clone)2个git repo,其中一个是React项目,我成功执行了命令npm run start-reactapp ,这样我就可以浏览网站了localhost:3000.

我还需要再启动一个Rails项目,否则后台功能(例如会员登录)会失效。但是我在执行npm run watching 的时候出现了如下错误,导致我无法进行到下一个rails服务器

npm ERR! Missing script: "watching"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/keaton/.npm/_logs/2021-12-17T03_20_47_673Z-debug.log

我该如何解决这个问题?

npm run watching 表示“运行 scripts.watching 中的命令在 package.json 中”。该错误消息表示您在 package.json 中定义的 "scripts" 对象中没有键 "watching"。因此,无论您在哪里获得 运行 npm run watching 的说明,您都需要找到应该在 package.json 中的条目并添加它。

有关 npm run 工作原理的详细信息,请参阅 npm-run-script docs