尝试运行 npm run dev “未找到条目。”
Posted
技术标签:
【中文标题】尝试运行 npm run dev “未找到条目。”【英文标题】:Trying to run npm run dev "No entries found." 【发布时间】:2019-08-11 20:36:20 【问题描述】:当我运行“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 【参考方案1】:不是这个
"dev": "parcel react/src/react.html"
这样做
"dev": "parcel src/react.html"
【讨论】:
【参考方案2】:你应该使用这样的主目录:frontend/index.html
【讨论】:
以上是关于尝试运行 npm run dev “未找到条目。”的主要内容,如果未能解决你的问题,请参考以下文章
如何在 localhost 中使用 HTTPS 运行 NUXT(npm run dev)?
为啥 webpack 在运行 npm run dev 时会报错
尝试 Laravel jetstream 但在“npm run dev”上出现错误