簡體   English   中英

將帶有Parcel的React App部署到Heroku提供中無法解決依賴關系錯誤

[英]Deploying React App with parcel to Heroku giving cannot resolve dependency error

我已經構建了一個小型應用程序,並試圖將其部署到Heroku,但我不斷收到此錯誤:無法解析依賴項'@ emotion / is-prop-valid'。 我沒有為此項目使用create-react-app。

完整的消息是:🚨/tmp/build_7241c20b1c425be31049d4add81a048a/node_modules/react-pose/lib/index.js:10:42:無法解析依賴項'@ 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"
  }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM