【问题标题】:I want to run a working website on my local computer, but I don't see anything being displayed我想在我的本地计算机上运行一个工作网站,但我没有看到任何显示
【发布时间】:2022-12-21 20:00:15
【问题描述】:

我想在我的本地计算机上运行 MERN 应用程序并可能对其进行更改/试用。 这是回购协议: https://github.com/Prince-Shivaram/online-grocerystore

我做了什么:我使用命令npm install 安装了所有依赖项并启动了 mongoDB。我使用命令nodemon server.js 启动了服务器。

结果控制台和浏览器中都没有错误。但是,在我的浏览器 (localhost:5000) 中,我没有看到正在显示的网站。我错过了什么?代码的某些部分是错误的吗?

让我知道我的解释是否不够清楚或者是否需要更多信息!

任何帮助表示赞赏,

谢谢 :)

【问题讨论】:

    标签: web-deployment


    【解决方案1】:

    在 online-grocerystore 文件夹中运行 npm install,然后在 front end 文件夹中再次运行。

    运行它使用:

    npm run dev
    

    它在 github 页面上这样说:

    如何在本地运行?

    git clone https://github.com/Prince-Shivaram/online-grocerystore
    cd online-grocerystore
    npm install
    cd frontend
    npm install
    # To run server you must have .env file in root project directory
    # see below .env file structure and replace with your values
    npm run dev
    # project starts
    

    .env 文件结构

    NODE_ENV = development
    PORT = 5000
    MONGO_URI = your mongodb uri
    JWT_SECRET = 'xxxxx'
    PAYPAL_CLIENT_ID = your paypal client id
    

    【讨论】:

    • 当我执行 git 命令时出现此错误:git:术语“git”未被识别为 cmdlet、函数、脚本文件或可运行程序的名称。检查名称的拼写,或者如果包含路径,请验证路径是否正确并重试。在第 1 行 char:1 + git clone github.com/Prince-Shivaram/online-grocerystore + ~~~ + CategoryInfo : ObjectNotFound: (git:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
    • 也许我必须在我的电脑上安装 git?
    • 在 online-grocerystore 文件夹中运行 npm install,然后在 front end 文件夹中再次运行。
    • @Louis-CharlesMarquis 并使用 npm run dev 运行它。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-11-04
    • 1970-01-01
    • 1970-01-01
    • 2016-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多