简体   繁体   English

在开始新的反应项目时,我遇到了这个问题

[英]On start new react project I have this problem

When I run npm start , I get this error.当我运行npm start ,出现此错误。 What is the solution for this?解决这个问题的方法是什么?

错误截图

This issue has been addressed here , you can refer to it. 这里已经解决这个问题,你可以参考一下。

Complete solution is完整的解决方案是

  • First add Poweshell to PATH as %SystemRoot%/system32/WindowsPowerShell/v1.0 .首先将 Poweshell 添加到 PATH 为%SystemRoot%/system32/WindowsPowerShell/v1.0
  • open powershell as admin and write this command Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force .以管理员身份打开 powershell 并编写此命令Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
  • last thing fire npm-windows-upgrade .最后一件事触发npm-windows-upgrade

Check your node version.检查您的节点版本。 update node & npm try sudo npm start if you are in macOS or linux try to download create-react-app again npm i -g create-react-app try to create the app in another folder create-react-app APPNAME Still not working?更新节点和 npm 尝试 sudo npm start 如果您在 macOS 或 linux 中尝试再次下载 create-react-app npm i -g create-react-app 尝试在另一个文件夹中创建应用 create-react-app APPNAME 仍然无法正常工作? Then delete node module folder and run npm install Not yet?然后删除 node 模块文件夹并运行 npm install 还没有? delete both node module & package-lock.json and npm install Try to run on another PORT删除节点模块和 package-lock.json 和 npm install 尝试在另一个端口上运行

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

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