无法建立反应项目aws

时间:2019-08-03 03:16:29

标签: reactjs amazon-web-services docker react-native

我正在尝试使用AWS管道构建项目,昨天所有功能都正常运行,昨天我推送了一个更新,此后构建失败。这是一个使用docker容器的React应用程序。

我尝试将代码恢复为先前成功构建的代码,但是仍然无法构建。我在本地计算机上运行容器,一切运行正常。

这是日志失败时的一部分

  

创建优化的生产版本...   编译失败。

     

./ node_modules/@coreui/react/node_modules/reactstrap/es/DropdownToggle.js

     

尝试导入错误:未从'react-popper'中导出'Reference'。

     

·[91mnpm·[0m·[91m·[0m·[91mERR!代码ELIFECYCLE

     

·[0m·[91mnpm错误! errno·[0m·[91m 1

     

·[0m·[91mnpm·[0m·[91mERR! compscout-sales@0.1.0构建:react-scripts build

     

npm错误!退出状态1

     

·[0m·[91mnpm错误!!

     

·[0m·[91mnpm错误!在compscout-sales@0.1.0构建脚本上失败。

     

npm·[0m·[91mERR! npm可能不是问题。上面可能还有其他日志记录输出。

     

·[0m·[91m

     

·[0m·[91mnpm错误!可以在以下位置找到此运行的完整日志:

     

npm ERR!·[0m·[91m /root/.npm/_logs/2019-08-03T02_48_42_802Z-debug.log

     

·[0m命令'/ bin / sh -c REACT_APP_STRIPE_PUBLISHABLE_KEY = $ REACT_APP_STRIPE_PUBLISHABLE_KEY npm run build'返回非零代码:1

     

make:*** [publish-app]错误1

     

[容器] 2019/08/03 02:48:48命令未成功退出,使发布应用退出状态为2

     

[容器] 2019/08/03 02:48:48完成阶段:建立状态:失败

     

[容器] 2019/08/03 02:48:48阶段上下文状态代码:COMMAND_EXECUTION_ERROR消息:执行命令时出错:make publish-app。原因:退出状态2

 "reactstrap": { 
  "version": "7.1.0", 
  "resolved": "https://registry.npmjs.org/reactstrap/-/reactstrap-7.1.0.tgz", 
  "integrity": "sha512-wtc4RkgnGn1TsZ0AxOZ2OqT+b8YmCWZj/tErPujWLepxzlEEhveZGC+uDerdaHVSAzJUP2DTk605iper7hutQQ==", 
  "requires": { 
    "@babel/runtime": "^7.2.0", 
    "classnames": "^2.2.3", 
    "lodash.isfunction": "^3.0.9", 
    "lodash.isobject": "^3.0.2", 
    "lodash.tonumber": "^4.0.3", 
    "prop-types": "^15.5.8", 
    "react-lifecycles-compat": "^3.0.4", 
    "react-popper": "^0.10.4", 
    "react-transition-group": "^2.3.1" 
  } 
}, 

"react-popper": { 
  "version": "0.10.4", 
  "resolved": "https://registry.npmjs.org/react-popper/-/react-popper-0.10.4.tgz", 
  "integrity": "sha1-rypBXqIike3VBGeNev2opu4ylao=", 
  "requires": { 
    "popper.js": "^1.14.1", 
    "prop-types": "^15.6.1" 
  } 
}, 

package.json

{
  "name": "myReactProjecr",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@coreui/coreui": "^2.1.7",
    "@coreui/coreui-plugin-chartjs-custom-tooltips": "^1.2.0",
    "@coreui/icons": "0.3.0",
    "@coreui/react": "^2.1.5",
    "axios": "^0.18.0",
    "body-parser": "^1.19.0",
    "bootstrap": "^4.3.1",
    "bootstrap-less": "^3.3.8",
    "chart.js": "^2.7.3",
    "classnames": "^2.2.6",
    "cookie-parser": "~1.4.3",
    "core-js": "^2.6.5",
    "cors": "^2.8.5",
    "debug": "~2.6.9",
    "dotenv": "^8.0.0",
    "enzyme": "^3.9.0",
    "enzyme-adapter-react-16": "^1.10.0",
    "exceljs": "^0.8.2",
    "express": "~4.16.0",
    "express-rate-limit": "^3.5.1",
    "flag-icon-css": "^3.3.0",
    "font-awesome": "^4.7.0",
    "http": "0.0.0",
    "http-errors": "~1.6.2",
    "https": "^1.0.0",
    "jade": "~1.11.0",
    "jquery": "^3.4.1",
    "jsonwebtoken": "^8.5.1",
    "moment": "^2.24.0",
    "morgan": "~1.9.0",
    "node-sass": "^4.11.0",
    "pg-promise": "^8.6.5",
    "prop-types": "^15.7.2",
    "ramda": "^0.26.1",
    "react": "^16.8.4",
    "react-apollo": "^2.5.6",
    "react-app-polyfill": "^0.2.1",
    "react-chartjs-2": "^2.7.4",
    "react-cookie": "^4.0.0",
    "react-dates": "^20.2.0",
    "react-dom": "^16.8.4",
    "react-js-pagination": "^3.0.2",
    "react-loadable": "^5.5.0",
    "react-redux": "^7.0.3",
    "react-router-config": "^4.4.0-beta.6",
    "react-router-dom": "^4.3.1",
    "react-select": "^2.4.3",
    "react-stripe-checkout": "^2.6.3",
    "react-stripe-elements": "^3.0.0",
    "react-test-renderer": "^16.8.4",
    "reactstrap": "^7.1.0",
    "redux": "^4.0.1",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.3.0",
    "request": "^2.88.0",
    "sequelize": "^5.8.7",
    "simple-line-icons": "^2.4.1",
    "stripe": "^6.34.0",
    "xlsx": "^0.11.19"
  },
  "devDependencies": {
    "react-scripts": "2.1.5"
  },
  "scripts": {
    "start": "react-scripts start",
    "start:server": "node ./server/www",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

2 个答案:

答案 0 :(得分:1)

我有同样的问题。通过更新最新版本的react-popper解决了该问题

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_story);


        webView = findViewById(R.id.webView3);
        title = findViewById(R.id.title);

         String description = "<p style="margin-bottom: 15px; padding: 0px; text-align: justify; font-size: 14px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla efficitur eros ut euismod feugiat. Duis efficitur, tortor non fermentum pulvinar, eros orci sodales nisi, ultrices eleifend enim enim id lacus. Phasellus vel commodo est. Sed nec mattis urna. Nunc non pretium nulla. Morbi pretium dolor leo, non tincidunt neque tristique quis. Nam molestie erat ac felis interdum convallis. Quisque quis justo tempor, faucibus sapien vitae, ornare quam. Phasellus imperdiet, dui vel dignissim porta, tortor massa blandit ante, eget imperdiet lectus ipsum ut turpis. Lorem ipsum dolor sit amet, consectetur adipiscing elit.<\\/p><p style="margin-bottom: 15px; padding: 0px; text-align: justify; font-size: 14px;">Suspendisse finibus lorem quis est lobortis vehicula. Morbi non dolor finibus, volutpat dolor eget, feugiat lacus. Maecenas odio sapien, consectetur sit amet pretium id, semper in nisl. Vivamus molestie ex commodo turpis tristique, eget volutpat risus posuere. Integer ex nunc, sollicitudin in faucibus sed, facilisis non urna. In sed ultrices risus. Fusce sit amet neque accumsan, malesuada quam eu, venenatis ligula. Vestibulum ullamcorper lorem sit amet nibh pretium, sed faucibus nibh vulputate. Duis porttitor nisi in mi interdum, ac pharetra mi maximus. Mauris vulputate metus odio, quis mattis ex ornare in. Aliquam faucibus ultrices lectus a venenatis. Quisque fringilla interdum ex laoreet accumsan. In hac habitasse platea dictumst. In pretium faucibus lorem. Phasellus non ultrices purus. Phasellus pulvinar tristique mattis.<\\/p><p style="margin-bottom: 15px; padding: 0px; text-align: justify; font-size: 14px;">Aliquam turpis ligula, tempus non dictum et, faucibus id nisl. Ut quis lorem sodales, molestie est et, facilisis elit. Donec sagittis, sapien a vestibulum placerat, turpis justo sollicitudin dolor, at pellentesque sapien ex ac nisl. Donec pretium odio a nunc bibendum malesuada. Nunc rhoncus, risus eu iaculis consequat, erat mi feugiat lorem, eget eleifend turpis libero quis sem. Donec tortor nisi, dictum sed velit quis, blandit tristique lectus. In consectetur fringilla imperdiet. Sed mattis sapien nibh, ac auctor dolor cursus eget. Vivamus cursus nec velit et vestibulum. Nunc laoreet fringilla consectetur. Sed sit amet diam in sem vestibulum placerat. Ut eu tristique diam.<\\/p><p style="margin-bottom: 15px; padding: 0px; text-align: justify; font-size: 14px;">Suspendisse cursus et arcu sed feugiat. Nulla tempus id nulla a luctus. Cras consectetur lectus ut aliquet euismod. Morbi tincidunt iaculis lectus, vel volutpat diam fringilla rutrum. Morbi at enim eget massa maximus commodo. Morbi sagittis pellentesque rhoncus. Aenean sit amet volutpat purus, id tristique dolor. Sed eget fermentum velit. Vestibulum ultrices mi sed volutpat posuere. Morbi vehicula quam risus, at pulvinar urna tempus et. Sed nulla risus, congue vel pharetra vel, pulvinar eu felis. Duis rhoncus accumsan enim, non vestibulum justo mattis eget. Pellentesque lacus turpis, facilisis ullamcorper gravida a, eleifend non metus. Nullam sed orci at mauris bibendum tempor. Donec consequat nulla nec sem ullamcorper, sed tincidunt velit ullamcorper.<\\/p><p style="margin-bottom: 15px; padding: 0px; text-align: justify; font-size: 14px;">Ut in aliquet erat. Vivamus pretium blandit sem, a aliquam lacus tincidunt ut. Ut ut lacinia diam, non maximus eros. Proin ipsum lacus, laoreet a felis sit amet, feugiat condimentum eros. Aenean iaculis enim non lacinia porttitor. Etiam in nibh ac nisl vehicula fringilla eu ac tellus. Proin sagittis magna vitae magna rutrum rhoncus. Fusce varius pharetra nulla, vel euismod orci malesuada id. Suspendisse potenti. Ut eu egestas est. Nam condimentum consequat massa sed rutrum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam posuere nulla in urna efficitur, nec pharetra ex feugiat. Sed lorem libero, iaculis ut elit et, placerat hendrerit lectus. Morbi efficitur diam ut erat dapibus porta quis vitae lectus.<\\/p>";

        webView.getSettings().setJavaScriptEnabled(true);
        webView.loadDataWithBaseURL("", description, "text/html", "UTF-8","");


    }

还有第二个与粉笔有关的错误。我也更新了

npm install react-popper

希望有帮助

答案 1 :(得分:0)

使其正常工作。我必须删除package-lock.json并删除我的节点模块,然后再次使用新的package-lock.json安装所有内容。