【问题标题】:Trying to run npm run dev "No entries found."尝试运行 npm run dev “未找到条目。”
【发布时间】:2023-03-12 15:55:02
【问题描述】:

当我运行“npm run dev”时,它给了我这个错误: 服务器运行在http://localhost:1234 ???未找到条目。 在 Bundler.bundle (/Users/igoraccebas/node_modules/parcel-bundler/src/Bundler.js:275:17) npm 错误!代码生命周期 npm 错误!错误号 1 npm 错误! @开发者:parcel react/src/react.html npm 错误!退出状态 1 npm 错误! npm 错误! @dev 脚本失败。 npm 错误!这可能不是 npm 的问题。上面可能还有额外的日志输出。

这是我的 package.json 文件

{
  "name": "adopt-me",
  "version": "1.0.0",
  "description": "An app to teach you to write React",
  "main": "react/src/App.js",
  "scripts": {
    "test": "",
    "format": "prettier --write \"src/**/*.{js,jsx}\"",
    "lint": "eslint \"src/**/*.{js,jsx}\" --quiet",
    "dev": "parcel react/src/react.html"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/btholt/complete-intro-to-react-v4.git"
  },
  "author": "Brian Holt <btholt@gmail.com>",
  "license": "Apache-2.0",
  "bugs": {
    "url": "https://github.com/btholt/complete-intro-to-react-v4/issues"
  },
  "homepage": "https://github.com/btholt/complete-intro-to-react-v4#readme",
  "devDependencies": {
    "babel-core": "^6.26.3",
    "babel-eslint": "^8.2.6",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-preset-env": "^1.7.0",
    "babel-preset-react": "^6.24.1",
    "eslint": "^5.3.0",
    "eslint-config-prettier": "^2.9.0",
    "eslint-plugin-import": "^2.13.0",
    "eslint-plugin-jsx-a11y": "^6.1.1",
    "eslint-plugin-react": "^7.10.0",
    "parcel-bundler": "^1.12.3",
    "prettier": "^1.14.2"
  },
  "dependencies": {
    "@reach/router": "^1.1.1",
    "petfinder-client": "^0.0.3",
    "react": "^16.4.2",
    "react-dom": "^16.4.2"
  }
}

【问题讨论】:

  • 你先运行 npm install 了吗?
  • 我确实运行了 npm install

标签: json reactjs parceljs


【解决方案1】:

不是这个

"dev": "parcel react/src/react.html"

这样做

"dev": "parcel src/react.html"

【讨论】:

    【解决方案2】:

    你应该使用这样的主目录:frontend/index.html

    【讨论】:

      猜你喜欢
      • 2020-02-18
      • 2021-08-11
      • 2023-01-21
      • 2019-10-28
      • 1970-01-01
      • 2018-12-12
      • 1970-01-01
      • 2018-02-05
      • 2016-11-01
      相关资源
      最近更新 更多