Npm Start:启动服务器时出错

时间:2020-09-02 11:02:11

标签: react-native npm expo npm-start expo-cli

我正在尝试运行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 个答案:

答案 0 :(得分:0)

解决方案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. 单击“确定”,然后重新启动终端,然后尝试重新安装