【问题标题】:React create-react-app npm start assistanceReact create-react-app npm start 帮助
【发布时间】:2019-09-23 02:05:44
【问题描述】:

我正在使用带有 bluehost 的 create-react-app 并正在使用 npm 来启动我的应用程序。我收到一堆错误,例如找不到 package.json,这与 npm 无法找到文件有关。我正在使用构建生产。任何帮助。谢谢。

【问题讨论】:

    标签: npm


    【解决方案1】:

    我要采取的第一步是检查你的 package.json 确保你有类似的东西

    "scripts": {
        "test": "jest",
        "start": "nodemon index.html"
      },
    

    这个 index.html 是当你键入 npm start 时将运行的脚本。我说的没错,接下来请确保您在输入 npm start 时位于项目根目录中。

    编辑:由于您的错误表明没有 package.json 文件,我会先查看选项 2

    【讨论】:

    • 添加了不存在的内容并获得了相同的结果。任何其他想法。
    • 我运行 npm install 并安装成功。我运行 npm start 并收到一个新错误:npm ERR! brettoconnordesigns@0.1.0 开始:react-scripts start & npm ERR!在 brettoconnordesigns@0.1.0 启动脚本失败。
    • { "name": "brettoconnordesigns", "homepage": "git@github.com:caretakerx/brettoconnordesigns.git", "version": "0.1.0", "private": false, "dependencies": { "firebase ":"4.2.0","react":"^16.8.6","react-dom":"^16.8.6","react-redux":"^7.1.0","react-router- dom": "^5.0.1", "react-scripts": "3.0.1", "redux": "^4.0.4" },
    • "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": “反应脚本弹出”,“预部署”:“npm run build”,“部署”:“gh-pages -d build”},
    • "eslintConfig": { "extends": "react-app" }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": ["last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] },
    猜你喜欢
    • 2017-02-18
    • 2018-09-06
    • 2020-09-23
    • 1970-01-01
    • 2019-11-19
    • 2021-01-03
    • 2019-05-07
    • 1970-01-01
    • 2020-11-17
    相关资源
    最近更新 更多