【问题标题】:Error while running React project in localhost在 localhost 中运行 React 项目时出错
【发布时间】:2021-04-13 10:13:33
【问题描述】:

我从 azure devOps 克隆了一个 repo 到我 D 盘的一个文件夹中。然后我运行命令 npm start 在 localhost 3000 中打开我的项目。它显示以下错误: 知道如何解决吗?

D:\>cd HWS


Cloning into 'Frontend'...
remote: Azure Repos
remote: Found 1081 objects to send. (200 ms)
Receiving objects: 100% (1081/1081), 774.29 KiB | 405.00 KiB/s, done.
Resolving deltas: 100% (645/645), done.

    D:\HWS>
    D:\HWS>npm start
    npm ERR! code ENOENT
    npm ERR! syscall open
    npm ERR! path D:\HWS\package.json
    npm ERR! errno -4058
    npm ERR! enoent ENOENT: no such file or directory, open 'D:\HWS\package.json'
    npm ERR! enoent This is related to npm not being able to find a file.
    npm ERR! enoent
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\Intel\AppData\Roaming\npm-cache\_logs\2021-01-07T15_52_13_775Z-debug.log
    
    D:\HWS>

【问题讨论】:

  • 检查您是否在package.json包含的正确路径中。

标签: reactjs npm web-development-server


【解决方案1】:

您需要从 Frontend 文件夹而不是 HWS 运行 npm start。因此,只需在克隆存储库后添加 cd Frontend 命令

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-22
    • 2018-07-21
    • 2015-05-31
    • 2020-11-18
    • 2016-04-13
    • 2020-02-19
    相关资源
    最近更新 更多