Shoutem / React-Native错误:“笑话贴图:@providesModule命名冲突”

时间:2018-10-22 17:14:16

标签: xcode react-native jestjs shoutem

我正在使用Shoutem,并尝试运行“ react-native run-ios”并直接运行xcode工作区文件。两者都使用会产生此错误(我意识到饭店拼写错误):

Loading dependency graph...(node:22499) UnhandledPromiseRejectionWarning: Error: jest-haste-map: @providesModule naming collision:
  Duplicate module name: user.resturants
  Paths: /Users/USERNAME/Resturaunts/user.resturants/server/package.json collides with /Users/USERNAME/Resturaunts/user.resturants/app/package.json

This error is caused by a @providesModule declaration with the same name across two different files.
    at setModule (/Users/USERNAME/Resturaunts/node_modules/jest-haste-map/build/index.js:446:17)
    at workerReply (/Users/USERNAME/Resturaunts/node_modules/jest-haste-map/build/index.js:496:9)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:19894) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:19894) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
error: bundling failed: Error: jest-haste-map: @providesModule naming collision:
  Duplicate module name: user.resturants
  Paths: /Users/USERNAME/Resturaunts/user.resturants/server/package.json collides with /Users/USERNAME/Resturaunts/user.resturants/app/package.json

This error is caused by a @providesModule declaration with the same name across two different files.
    at setModule (/Users/USERNAME/Resturaunts/node_modules/jest-haste-map/build/index.js:446:17)
    at workerReply (/Users/USERNAME/Resturaunts/node_modules/jest-haste-map/build/index.js:496:9)
    at process._tickCallback (internal/process/next_tick.js:68:7)
 BUNDLE  [ios, dev] ../../index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1), failed.

我尝试按照here所示的步骤进行操作,但仍然遇到相同的问题。

使用'react-native run-ios'也会在终端中显示此错误。我不确定这是否相关。

The following commands produced analyzer issues:
    Analyze /Users/USERNAME/Resturaunts/node_modules/react-native/React/Base/RCTModuleMethod.mm normal x86_64
    Analyze /Users/USERNAME/Resturaunts/node_modules/react-native/React/Base/RCTUtils.m normal x86_64
(2 commands with analyzer issues)

Installing build/Build/Products/Debug-iphonesimulator/Resturaunts.app
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=164):
Unable to lookup in current state: Shutdown
Launching com.shoutem.ShoutemApp
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=164):
Unable to lookup in current state: Shutdown

构建确实成功,但是模拟器什么也没有显示。我也尝试过此解决方案here。我没有足够的经验来了解发生了什么。我一直在尝试使这个东西工作一段时间。这是我所能找到的最接近的可用版本。

这是我的package.json:

    {
  "name": "@shoutem/platform",
  "version": "1.7.1-rc.0",
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "setup": "cd scripts && yarn install",
    "lint": "eslint .",
    "configure": "node scripts/configure",
    "bundle": "node scripts/bundle",
    "build": "node scripts/build"
  },
  "dependencies": {
    "@shoutem/animation": "~0.12.2",
    "@shoutem/core": "0.2.5",
    "@shoutem/redux-composers": "0.1.4",
    "@shoutem/redux-io": "3.0.1-beta.3",
    "@shoutem/theme": "~0.11.2",
    "@shoutem/ui": "0.23.6",
    "@shoutem/ui-addons": "0.0.29",
    "babel-preset-es2015": "~6.24.1",
    "es6-symbol": "3.1.1",
    "lodash": "~4.17.4",
    "moment": "2.22.2",
    "prop-types": "15.6.0",
    "react": "16.4.1",
    "react-native": "0.56.0",
    "react-redux": "~5.0.2",
    "redux": "~3.6.0",
    "redux-action-buffer": "~1.0.1",
    "redux-api-middleware": "2.0.1",
    "redux-logger": "2.6.1",
    "redux-persist": "4.1.0",
    "redux-thunk": "~2.0.0",
    "whatwg-fetch": "1.0.0",
    "user.resturants": "https://extensions.static.shoutem.com/user/resturants/0.0.1/app.tgz?timestamp=1540222210009",
    "shoutem.about": "https://extensions.static.shoutem.com/shoutem/about/1.7.1/app.tgz?timestamp=1532019904679",
    "shoutem.analytics": "https://extensions.static.shoutem.com/shoutem/analytics/1.7.0/app.tgz?timestamp=1531924714589",
    "shoutem.application": "https://extensions.static.shoutem.com/shoutem/application/1.7.0/app.tgz?timestamp=1531924719204",
    "shoutem.auth": "https://extensions.static.shoutem.com/shoutem/auth/1.7.1/app.tgz?timestamp=1533647965562",
    "shoutem.books": "https://extensions.static.shoutem.com/shoutem/books/1.7.0/app.tgz?timestamp=1531924805228",
    "shoutem.camera": "https://extensions.static.shoutem.com/shoutem/camera/1.7.1/app.tgz?timestamp=1532513463813",
    "shoutem.cms": "https://extensions.static.shoutem.com/shoutem/cms/1.7.0/app.tgz?timestamp=1531924864035",
    "shoutem.code-push": "https://extensions.static.shoutem.com/shoutem/code-push/1.7.0/app.tgz?timestamp=1531924869983",
    "shoutem.deals": "https://extensions.static.shoutem.com/shoutem/deals/1.7.2/app.tgz?timestamp=1531930828925",
    "shoutem.events": "https://extensions.static.shoutem.com/shoutem/events/1.7.1/app.tgz?timestamp=1532513603690",
    "shoutem.favorites": "https://extensions.static.shoutem.com/shoutem/favorites/1.7.1/app.tgz?timestamp=1531924890654",
    "shoutem.flurry-analytics": "https://extensions.static.shoutem.com/shoutem/flurry-analytics/1.7.0/app.tgz?timestamp=1531925003203",
    "shoutem.google-analytics": "https://extensions.static.shoutem.com/shoutem/google-analytics/1.7.0/app.tgz?timestamp=1531925048071",
    "shoutem.i18n": "https://extensions.static.shoutem.com/shoutem/i18n/1.7.0/app.tgz?timestamp=1531926118452",
    "shoutem.ical-events": "https://extensions.static.shoutem.com/shoutem/ical-events/1.7.1/app.tgz?timestamp=1532513791098",
    "shoutem.layouts": "https://extensions.static.shoutem.com/shoutem/layouts/1.7.0/app.tgz?timestamp=1531925159116",
    "shoutem.loyalty": "https://extensions.static.shoutem.com/shoutem/loyalty/1.7.7/app.tgz?timestamp=1534422589121",
    "shoutem.menu": "https://extensions.static.shoutem.com/shoutem/menu/1.7.0/app.tgz?timestamp=1531925240759",
    "shoutem.navigation": "https://extensions.static.shoutem.com/shoutem/navigation/1.7.1/app.tgz?timestamp=1534422615806",
    "shoutem.news": "https://extensions.static.shoutem.com/shoutem/news/1.7.0/app.tgz?timestamp=1531925281565",
    "shoutem.notification-center": "https://extensions.static.shoutem.com/shoutem/notification-center/1.7.0/app.tgz?timestamp=1531925287012",
    "shoutem.page": "https://extensions.static.shoutem.com/shoutem/page/1.7.0/app.tgz?timestamp=1531925310994",
    "shoutem.people": "https://extensions.static.shoutem.com/shoutem/people/1.7.0/app.tgz?timestamp=1531925316211",
    "shoutem.persist": "https://extensions.static.shoutem.com/shoutem/persist/1.7.0/app.tgz?timestamp=1531925320758",
    "shoutem.photos": "https://extensions.static.shoutem.com/shoutem/photos/1.7.0/app.tgz?timestamp=1531925325437",
    "shoutem.places": "https://extensions.static.shoutem.com/shoutem/places/1.7.0/app.tgz?timestamp=1531925330220",
    "shoutem.platform-analytics": "https://extensions.static.shoutem.com/shoutem/platform-analytics/1.7.0/app.tgz?timestamp=1531925334766",
    "shoutem.preview": "https://extensions.static.shoutem.com/shoutem/preview/1.7.0/app.tgz?timestamp=1531925340045",
    "shoutem.products": "https://extensions.static.shoutem.com/shoutem/products/1.7.0/app.tgz?timestamp=1531925346246",
    "shoutem.push-notifications": "https://extensions.static.shoutem.com/shoutem/push-notifications/1.7.0/app.tgz?timestamp=1531925350876",
    "shoutem.rss": "https://extensions.static.shoutem.com/shoutem/rss/1.7.0/app.tgz?timestamp=1531925392345",
    "shoutem.rss-news": "https://extensions.static.shoutem.com/shoutem/rss-news/1.7.0/app.tgz?timestamp=1531925397913",
    "shoutem.rss-photos": "https://extensions.static.shoutem.com/shoutem/rss-photos/1.7.0/app.tgz?timestamp=1531925402877",
    "shoutem.rss-videos": "https://extensions.static.shoutem.com/shoutem/rss-videos/1.7.0/app.tgz?timestamp=1531925407618",
    "shoutem.rubicon-theme": "https://extensions.static.shoutem.com/shoutem/rubicon-theme/1.7.2/app.tgz?timestamp=1534422920061",
    "shoutem.shopify": "https://extensions.static.shoutem.com/shoutem/shopify/1.7.0/app.tgz?timestamp=1531925522991",
    "shoutem.social": "https://extensions.static.shoutem.com/shoutem/social/1.7.0/app.tgz?timestamp=1531925590399",
    "shoutem.sub-navigation": "https://extensions.static.shoutem.com/shoutem/sub-navigation/1.7.1/app.tgz?timestamp=1534423025262",
    "shoutem.theme": "https://extensions.static.shoutem.com/shoutem/theme/1.7.0/app.tgz?timestamp=1531925600521",
    "shoutem.video": "https://extensions.static.shoutem.com/shoutem/video/1.7.0/app.tgz?timestamp=1531925610624",
    "shoutem.vimeo": "https://extensions.static.shoutem.com/shoutem/vimeo/1.7.0/app.tgz?timestamp=1531925661052",
    "shoutem.web-view": "https://extensions.static.shoutem.com/shoutem/web-view/1.7.2/app.tgz?timestamp=1531925714059",
    "shoutem.wordpress": "https://extensions.static.shoutem.com/shoutem/wordpress/1.7.0/app.tgz?timestamp=1531925779176",
    "shoutem.youtube": "https://extensions.static.shoutem.com/shoutem/youtube/1.7.0/app.tgz?timestamp=1531925850488"
  },
  "devDependencies": {
    "@shoutem/build-tools": "file:scripts/helpers",
    "babel": "~6.3.26",
    "babel-eslint": "~6.0.4",
    "babel-jest": "23.2.0",
    "babel-plugin-transform-decorators-legacy": "~1.3.4",
    "babel-preset-react-native": "^5.0.1",
    "eslint": "~2.9.0",
    "eslint-config-airbnb": "~8.0.0",
    "eslint-plugin-import": "~1.6.1",
    "eslint-plugin-jsx-a11y": "~1.0.4",
    "eslint-plugin-react": "~5.0.1",
    "eslint-plugin-react-native": "~1.0.2",
    "jest": "23.1.0",
    "react-test-renderer": "16.4.1"
  },
  "jest": {
    "preset": "react-native",
    "transformIgnorePatterns": [
      "node_modules/(?!react-native|@shoutem/theme|@shoutem/animation|@shoutem/ui)"
    ]
  }
}

您可以按照shoutem tutorial进行复制。我停在链接的部分(设置本地环境)。运行'react-native run-ios'时也出现错误,但通过遵循this

解决了

0 个答案:

没有答案