Npm Start:启动服务器时出错

问题描述

我正在尝试运行npm服务器,但出现错误

Expo DevTools is running at http://localhost:19002
opening DevTools in the browser... (press shift-d to disable)
Error: spawn powershell ENOENT
   at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
   at onErrorNT (internal/child_process.js:468:16)
   at processticksAndRejections (internal/process/task_queues.js:80:21)
npm ERR! code ELIFECYCLE 
npm ERR! errno 1
npm ERR! @ start: `expo start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Danger World\AppData\Roaming\npm-cache\_logs\2020-09-02T10_54_16_635Z-debug.log

任何人都可以帮助我

解决方法

解决方案1 ​​---

  1. 首先将Powershell作为%SystemRoot%/ system32 / WindowsPowerShell / v1.0添加到PATH。
  2. 以管理员身份打开powershell并编写此命令Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force。
  3. 最后一件事是npm-windows-upgrade。

解决方案2 ---

  1. 将%SystemRoot%/ system32 / WindowsPowerShell / v1.0添加到PATH变量中,
  2. cmd + q并搜索环境,然后按Enter键
  3. 在高级标签中点击环境变量
  4. 找到“路径/ PATH”变量,然后单击“编辑”
  5. 单击新建,然后粘贴%SystemRoot%/ system32 / WindowsPowerShell / v1.0
  6. 单击“确定”,然后重新启动终端,然后尝试重新安装

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...