简体   繁体   English

React.js npm start 什么都不做

[英]React.js npm start does nothing

Using Mac OS Catalina & Node 12.13.1.使用 Mac OS Catalina 和 Node 12.13.1。 I'm trying to launch my React app to no avail.我试图启动我的 React 应用程序无济于事。

When I run $ npm start in my VS Code terminal, nothing happens.当我在 VS Code 终端中运行$ npm start时,没有任何反应。 No errors or issues are returned.不会返回任何错误或问题。

I have tried deleting Homebrew, in case there were conflicts.我试过删除 Homebrew,以防发生冲突。 I've uninstalled a Windows SSD partition.我已经卸载了 Windows SSD 分区。 I've tried un/reinstalling node.js.我试过卸载/重新安装 node.js。 I've tried to edit ~/.zshrc AND ~/.bash_profiles.我试图编辑 ~/.zshrc 和 ~/.bash_profiles。

I'm simply trying to run my default React app.我只是想运行我的默认 React 应用程序。

Any help is massively appreciated.任何帮助都非常感谢。

the same problem encountered for me.我遇到了同样的问题。 expecting a solution.期待解决方案。 I am in the root folder ie my project name is amdb, I am inside amdb folder and tried npm start , npm run start , it returns nothing.我在根文件夹中,即我的项目名称是 amdb,我在 amdb 文件夹中并尝试了npm startnpm run start ,它什么都不返回。

then I found answer on stackoverflow.然后我在stackoverflow上找到了答案。


npm has a ignore-scripts configuration key. npm 有一个ignore-scripts配置键。 It's expected value is a Boolean and it's set to false by default.它的预期值是一个布尔值,默认设置为false

Perhaps it has inadvertently been set to true.也许它无意中被设置为true。

To get / set the ignore-scripts configuration you can utilize the npm-config command:get / set ignore-scripts配置,您可以使用 npm-config 命令:

Check its current setting by running:通过运行检查其当前设置:

npm config get ignore-scripts

If the aforementioned command returns true then reset it to false by running:如果上述命令返回 true,则通过运行将其重置为 false:

npm config set ignore-scripts false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM