gpt4 book ai didi

javascript - 将带有包裹的 React App 部署到 Heroku 提供无法解决依赖性错误

转载 作者:行者123 更新时间:2023-11-30 06:21:57 26 4
gpt4 key购买 nike

我构建了一个小应用程序并尝试将其部署到 Heroku,但我不断收到此错误:无法解析依赖项“@emotion/is-prop-valid”。我没有为这个项目使用 create-react-app。

完整的消息是:🚨/tmp/build_7241c20b1c425be31049d4add81a048a/node_modules/react-pose/lib/index.js:10:42: Cannot resolve dependency '@emotion/is-prop-valid'

package.json 文件如下所示:

{
"name": "name",
"version": "2.0.0",
"description": "description",
"engines": {
"npm": "6.0.0",
"node": "10.9.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"format": "prettier --write \"src/**/*.{js,jsx,css,json}\"",
"format:check": "prettier --list-different \" src/**/*.{js,jsx,css,json}\"",
"lint": "eslint \" eslint src/**/*,{js,jsx}\"",
"dev": "parcel src/index.html",
"start": "serve -s build",
"build": "parcel build src/index.html",
"heroku-postbuild": "parcel build src/index.html"
},
"repository": {
"type": "git",
"url": "url"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.6.1",
"eslint-config-prettier": "^3.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-prettier": "^2.7.0",
"eslint-plugin-react": "^7.11.1",
"parcel-bundler": "^1.10.1",
"prettier": "^1.14.3"
},
"dependencies": {
"@reach/router": "^1.2.1",
"axios": "^0.18.0",
"prop-types": "^15.6.2",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-pose": "^3.3.6",
"react-spring": "^5.9.0",
"serve": "^10.0.2"
}
}

我环顾四周,但找不到其他人遇到此类错误。我的理论是 react-pose 依赖于那个情感模块,但我不知道如何让 Heroku 下载它。

任何帮助将不胜感激,谢谢!

最佳答案

试试这个:

{
"name": "name",
"version": "2.0.0",
"description": "description",
"engines": {
"npm": "6.0.0",
"node": "10.9.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"format": "prettier --write \"src/**/*.{js,jsx,css,json}\"",
"format:check": "prettier --list-different \" src/**/*.{js,jsx,css,json}\"",
"lint": "eslint \" eslint src/**/*,{js,jsx}\"",
"dev": "parcel src/index.html",
"start": "./node_modules/parcel-bundler/bin/cli.js src/index.html",
"build": "parcel build src/index.html",
"heroku-postbuild": "parcel build src/index.html"
},
"repository": {
"type": "git",
"url": "url"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.6.1",
"eslint-config-prettier": "^3.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-prettier": "^2.7.0",
"eslint-plugin-react": "^7.11.1",
"parcel-bundler": "^1.10.1",
"prettier": "^1.14.3"
},
"dependencies": {
"@reach/router": "^1.2.1",
"axios": "^0.18.0",
"prop-types": "^15.6.2",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-pose": "^3.3.6",
"react-spring": "^5.9.0",
"serve": "^10.0.2"
}
}

关于javascript - 将带有包裹的 React App 部署到 Heroku 提供无法解决依赖性错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52638903/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com