0

使用羽毛、nodejs、mongodb、react 在heroku 上部署react-boilerplate 时出现错误。我在 package.json 中指定了最新版本,并尝试使用 npm 和 yarn 进行构建,但都失败了。我感谢您的帮助!

  "engines": {
    "npm": ">=6.4.1",
    "node": ">=v8.12.0",
    "yarn": ">=1.10.1"
  },

试用 1:使用 npm 安装。错误:sh:1:节点预gyp:未找到

   NPM_CONFIG_LOGLEVEL=error
   NPM_CONFIG_PRODUCTION=true
   YARN_PRODUCTION=false
   NODE_VERBOSE=false
   NODE_ENV=production
   NODE_MODULES_CACHE=true

-----> Installing binaries
       engines.node (package.json):  >=v8.12.0
       engines.npm (package.json):   >=6.4.1

   Resolving node version >=v8.12.0...
   Downloading and installing node 10.12.0...
   Bootstrapping npm >=6.4.1 (replacing 6.4.1)...
   npm >=6.4.1 installed
   Resolving yarn version >=1.10.1...
   Downloading and installing yarn (1.12.0)...
   Installed yarn 1.12.0

   > grpc@1.15.1 install /tmp/build_e7799f363b624e57eda6680a757c4fd4/node_modules/grpc
   > node-pre-gyp install --fallback-to-build --library=static_library

   sh: 1: node-pre-gyp: not found
   npm ERR! file sh
   npm ERR! code ELIFECYCLE
   npm ERR! errno ENOENT
   npm ERR! syscall spawn
   npm ERR! grpc@1.15.1 install: `node-pre-gyp install --fallback-to-build --library=static_library`
   npm ERR! spawn ENOENT
   npm ERR! 
   npm ERR! Failed at the grpc@1.15.1 install script.
   npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

试用 2:使用 yarn 安装。错误:错误:生成 webpack ENOENT

       NPM_CONFIG_LOGLEVEL=error
       YARN_PRODUCTION=true
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true

-----> Installing binaries
       engines.node (package.json):  >=v8.12.0
       engines.npm (package.json):   >=6.4.1
       engines.yarn (package.json):  >=1.10.1

       Resolving node version >=v8.12.0...
       Downloading and installing node 10.12.0...
       Bootstrapping npm >=6.4.1 (replacing 6.4.1)...
       npm >=6.4.1 installed
       Resolving yarn version >=1.10.1...
       Downloading and installing yarn (1.12.0)...
       Installed yarn 1.12.0


       > seunghunlee-software@3.6.0 build /tmp/build_edb00e4a7279e6636f35f9ea79a9d0f8
       > cross-env NODE_ENV=production webpack --config internals/webpack/webpack.prod.babel.js --color -p --progress --hide-modules --display-optimization-bailout

events.js:167
      throw er; // Unhandled 'error' event
      ^
Error: spawn webpack ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
    at onErrorNT (internal/child_process.js:407:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:744:11)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
    at onErrorNT (internal/child_process.js:407:16)
    [... lines matching original stack trace ...]
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)

//package.json

  "dependencies": {
    "@feathersjs/authentication": "^2.0.1",
    "@feathersjs/authentication-client": "^1.0.6",
    "@feathersjs/authentication-jwt": "^2.0.0",
    "@feathersjs/authentication-local": "^1.0.2",
    "@feathersjs/authentication-oauth2": "^1.2.2",
    "@feathersjs/client": "^3.7.3",
    "@feathersjs/configuration": "^1.0.1",
    "@feathersjs/errors": "^3.2.0",
    "@feathersjs/express": "^1.1.2",
    "@feathersjs/feathers": "^3.2.3",
    "@feathersjs/socketio": "^3.0.1",
    "@feathersjs/socketio-client": "^1.1.4",
    "@google-cloud/vision": "^0.19.0",
    "Dante2": "0.5.0-rc5",
    "antd": "^3.10.1",
    "apiai": "^4.0.3",
    "axios": "^0.18.0",
    "babel-polyfill": "6.26.0",
    "body-parser": "^1.18.3",
    "chalk": "2.4.1",
    "compression": "1.7.2",
    "cors": "^2.8.4",
    "cross-env": "5.2.0",
    "disqus-react": "^1.0.5",
    "dotenv": "^6.0.0",
    "draft-js": "^0.10.5",
    "draftjs-to-html": "^0.8.4",
    "express": "4.16.3",
    "faker": "^4.1.0",
    "feathers-mongoose": "^6.1.4",
    "feathers-sync": "^1.0.3",
    "fontfaceobserver": "2.0.13",
    "googleapis": "^32.0.0",
    "helmet": "^3.9.0",
    "heroku-ssl-redirect": "^0.0.4",
    "history": "4.7.2",
    "hoist-non-react-statics": "2.5.5",
    "html-to-draftjs": "^1.4.0",
    "immutability-helper": "2.4.0",
    "immutable": "3.8.2",
    "intl": "1.2.5",
    "invariant": "2.2.4",
    "ip": "1.1.5",
    "lodash": "4.17.10",
    "lqip.macro": "^0.1.5",
    "minimist": "1.2.0",
    "moment": "^2.22.2",
    "moment-range": "^4.0.1",
    "mongoose": "^5.2.13",
    "passport-facebook": "^2.1.1",
    "passport-facebook-token": "^3.3.0",
    "passport-google-oauth2": "^0.1.6",
    "passport-google-oauth20": "^1.0.0",
    "passport-google-token": "^0.1.2",
    "pica": "^4.1.1",
    "prismjs": "^1.15.0",
    "prop-types": "15.6.1",
    "react": "16.4.1",
    "react-burger-menu": "^2.5.4",
    "react-camera": "^0.1.3",
    "react-color": "^2.14.1",
    "react-cookie-consent": "^1.9.0",
    "react-datepicker": "^1.4.1",
    "react-dnd": "^2.6.0",
    "react-dnd-html5-backend": "^2.6.0",
    "react-dom": "16.4.1",
    "react-draft-wysiwyg": "^1.12.13",
    "react-ga": "^2.5.3",
    "react-helmet": "5.2.0",
    "react-ideal-image": "^0.0.5",
    "react-image-gallery": "^0.8.6",
    "react-images": "^0.5.13",
    "react-intl": "2.4.0",
    "react-lazyload": "^2.3.0",
    "react-loadable": "5.4.0",
    "react-redux": "5.0.7",
    "react-router-dom": "4.3.1",
    "react-router-redux": "5.0.0-alpha.9",
    "react-typist": "^2.0.4",
    "react-vis": "^1.9.2",
    "reactcss": "^1.2.3",
    "redux": "4.0.0",
    "redux-form": "^7.3.0",
    "redux-form-antd": "^1.0.5",
    "redux-immutable": "4.0.0",
    "redux-persist": "^5.9.1",
    "redux-saga": "0.16.0",
    "redux-thunk": "^2.3.0",
    "reselect": "3.0.1",
    "sanitize.css": "4.1.0",
    "serve-favicon": "^2.4.5",
    "socket.io": "^2.0.4",
    "socket.io-client": "^2.1.1",
    "spotify-web-api-node": "^3.1.1",
    "styled-components": "3.3.2",
    "uuid": "^3.3.2",
    "voucher-code-generator": "^1.1.1",
    "warning": "4.0.1",
    "web3": "^1.0.0-beta.36",
    "whatwg-fetch": "2.0.4",
    "winston": "^3.0.0"
  },
  "devDependencies": {
    "add-asset-html-webpack-plugin": "2.1.3",
    "babel-cli": "6.26.0",
    "babel-core": "6.26.3",
    "babel-eslint": "8.2.3",
    "babel-loader": "7.1.4",
    "babel-plugin-dynamic-import-node": "1.2.0",
    "babel-plugin-import": "^1.10.0",
    "babel-plugin-react-intl": "2.4.0",
    "babel-plugin-react-transform": "3.0.0",
    "babel-plugin-styled-components": "1.5.1",
    "babel-plugin-transform-es2015-modules-commonjs": "6.26.2",
    "babel-plugin-transform-react-constant-elements": "6.23.0",
    "babel-plugin-transform-react-inline-elements": "6.22.0",
    "babel-plugin-transform-react-jsx-source": "6.22.0",
    "babel-plugin-transform-react-remove-prop-types": "0.4.13",
    "babel-preset-env": "1.7.0",
    "babel-preset-react": "6.24.1",
    "babel-preset-stage-0": "6.24.1",
    "circular-dependency-plugin": "5.0.2",
    "coveralls": "3.0.1",
    "css-loader": "0.28.11",
    "enzyme": "3.3.0",
    "enzyme-adapter-react-16": "1.1.1",
    "enzyme-to-json": "3.3.4",
    "eslint": "4.19.1",
    "eslint-config-airbnb": "16.1.0",
    "eslint-config-airbnb-base": "12.1.0",
    "eslint-config-prettier": "2.9.0",
    "eslint-import-resolver-webpack": "0.10.0",
    "eslint-plugin-import": "2.12.0",
    "eslint-plugin-jsx-a11y": "6.0.3",
    "eslint-plugin-prettier": "2.6.0",
    "eslint-plugin-react": "7.9.1",
    "eslint-plugin-redux-saga": "0.9.0",
    "eventsource-polyfill": "0.9.6",
    "exports-loader": "0.7.0",
    "feathers-memory": "^2.1.0",
    "file-loader": "1.1.11",
    "html-loader": "0.5.5",
    "html-webpack-plugin": "3.2.0",
    "husky": "0.14.3",
    "image-webpack-loader": "^4.4.0",
    "imports-loader": "0.8.0",
    "jest-cli": "23.1.0",
    "jest-styled-components": "5.0.1",
    "lint-staged": "7.2.0",
    "ngrok": "3.0.1",
    "node-plop": "0.15.0",
    "null-loader": "0.1.1",
    "offline-plugin": "5.0.5",
    "plop": "2.0.0",
    "pre-commit": "1.2.2",
    "prettier": "1.13.5",
    "react-test-renderer": "16.4.1",
    "rimraf": "2.6.2",
    "shelljs": "0.8.2",
    "style-loader": "0.21.0",
    "stylelint": "9.3.0",
    "stylelint-config-recommended": "2.1.0",
    "stylelint-config-styled-components": "0.1.1",
    "stylelint-processor-styled-components": "1.3.1",
    "svg-url-loader": "2.3.2",
    "url-loader": "1.0.1",
    "webpack": "4.12.0",
    "webpack-cli": "3.0.8",
    "webpack-dev-middleware": "3.1.3",
    "webpack-hot-middleware": "2.22.2",
    "webpack-pwa-manifest": "3.6.2"
  }
4

2 回答 2

0

问题是没有安装bcrypt库。

bcrypt您可以安装和使用使用bcryptjs纯 JavaScript 而不是 C++ 实现的同一个库,而不是安装和使用。

于 2019-03-08T08:05:54.813 回答
0

我有这个错误............

   sh: 1: node-pre-gyp: not found

将我的应用程序部署到heroku时。

为了解决这个问题,我 "node-pre-gyp": "^0.16.0", 在 package.json 中添加了第一个依赖项,以便 heroku 在需要它的任何其他库之前安装它。

任何版本的 node-pre-gyp 都可以正常工作。

于 2020-11-25T14:21:48.567 回答