我正在构建一个Node.js应用程序并部署在Heroku上。当我尝试在Heroku上部署时,我得到以下错误:
remote: -----> Installing dependencies
remote: Installing node modules
remote: npm ERR! code EUSAGE
remote: npm ERR!
remote: npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
remote: npm ERR!
remote: npm ERR! Missing: multer@1.4.5-lts.1 from lock file
remote: npm ERR! Missing: vuejs-datepicker@1.6.2 from lock file
remote: npm ERR! Missing: fast-deep-equal@3.1.3 from lock file
remote: npm ERR! Missing: append-field@1.0.0 from lock file
remote: npm ERR! Missing: busboy@1.6.0 from lock file
remote: npm ERR! Missing: streamsearch@1.1.0 from lock file
remote: npm ERR! Invalid: lock file's webpack@4.46.0 does not satisfy webpack@5.73.0
remote: npm ERR! Missing: webpack@4.46.0 from lock file
remote: npm ERR! Missing: @intervolga/optimize-cssnano-plugin@1.0.6 from lock file
remote: npm ERR! Missing: webpack@4.46.0 from lock file
remote: npm ERR! Missing: @vue/preload-webpack-plugin@1.1.2 from lock file
remote: npm ERR! Missing: html-webpack-plugin@3.2.0 from lock file
remote: npm ERR! Missing: cache-loader@4.1.0 from lock file
remote: npm ERR! Missing: file-loader@4.3.0 from lock file
remote: npm ERR! Missing: mini-css-extract-plugin@0.9.0 from lock file
remote: npm ERR! Missing: terser-webpack-plugin@1.4.5 from lock file
remote: npm ERR! Missing: thread-loader@2.1.3 from lock file
remote: npm ERR! Missing: url-loader@2.3.0 from lock file
remote: npm ERR! Missing: @types/eslint-scope@3.7.3 from lock file
remote: npm ERR! Missing: @types/estree@0.0.51 from lock file
remote: npm ERR! Invalid: lock file's @webassemblyjs/ast@1.9.0 does not satisfy @webassemblyjs/ast@1.11.1
remote: npm ERR! Invalid: lock file's @webassemblyjs/wasm-edit@1.9.0 does not satisfy @webassemblyjs/wasm-edit@1.11.1
remote: npm ERR! Invalid: lock file's @webassemblyjs/wasm-parser@1.9.0 does not satisfy @webassemblyjs/wasm-parser@1.11.1
remote: npm ERR! Invalid: lock file's acorn@6.4.2 does not satisfy acorn@8.7.1
remote: npm ERR! Missing: acorn-import-assertions@1.8.0 from lock file
remote: npm ERR! Invalid: lock file's enhanced-resolve@4.5.0 does not satisfy enhanced-resolve@5.9.3
remote: npm ERR! Missing: es-module-lexer@0.9.3 from lock file
remote: npm ERR! Missing: eslint-scope@5.1.1 from lock file
remote: npm ERR! Missing: glob-to-regexp@0.4.1 from lock file
remote: npm ERR! Invalid: lock file's graceful-fs@4.2.8 does not satisfy graceful-fs@4.2.10
remote: npm ERR! Missing: loader-runner@4.3.0 from lock file
remote: npm ERR! Invalid: lock file's schema-utils@1.0.0 does not satisfy schema-utils@3.1.1
remote: npm ERR! Missing: tapable@2.2.1 from lock file
remote: npm ERR! Invalid: lock file's terser-webpack-plugin@1.4.5 does not satisfy terser-webpack-plugin@5.3.3
remote: npm ERR! Invalid: lock file's watchpack@1.7.5 does not satisfy watchpack@2.4.0
remote: npm ERR! Missing: webpack-sources@3.2.3 from lock file
remote: npm ERR! Missing: @types/eslint@8.4.3 from lock file
remote: npm ERR! Missing: @webassemblyjs/helper-numbers@1.11.1 from lock file
remote: npm ERR! Invalid: lock file's @webassemblyjs/helper-wasm-bytecode@1.9.0 does not satisfy @webassemblyjs/helper-wasm-bytecode@1.11.1
remote: npm ERR! Invalid: lock file's @webassemblyjs/floating-point-hex-parser@1.9.0 does not satisfy @webassemblyjs/floating-point-hex-parser@1.11.1
remote: npm ERR! Invalid: lock file's @webassemblyjs/helper-api-error@1.9.0 does not satisfy @webassemblyjs/helper-api-error@1.11.1
remote: npm ERR! Invalid: lock file's @webassemblyjs/helper-buffer@1.9.0 does not satisfy @webassemblyjs/helper-buffer@1.11.1
remote: npm ERR! Invalid: lock file's @webassemblyjs/helper-wasm-section@1.9.0 does not satisfy @webassemblyjs/helper-wasm-section@1.11.1
remote: npm ERR! Invalid: lock file's @webassemblyjs/wasm-gen@1.9.0 does not satisfy @webassemblyjs/wasm-gen@1.11.1
remote: npm ERR! Invalid: lock file's @webassemblyjs/wasm-opt@1.9.0 does not satisfy @webassemblyjs/wasm-opt@1.11.1
remote: npm ERR! Invalid: lock file's @webassemblyjs/wast-printer@1.9.0 does not satisfy @webassemblyjs/wast-printer@1.11.1
remote: npm ERR! Invalid: lock file's @webassemblyjs/ieee754@1.9.0 does not satisfy @webassemblyjs/ieee754@1.11.1
remote: npm ERR! Invalid: lock file's @webassemblyjs/leb128@1.9.0 does not satisfy @webassemblyjs/leb128@1.11.1
remote: npm ERR! Invalid: lock file's @webassemblyjs/utf8@1.9.0 does not satisfy @webassemblyjs/utf8@1.11.1
remote: npm ERR! Missing: tapable@2.2.1 from lock file
remote: npm ERR! Missing: @jridgewell/trace-mapping@0.3.13 from lock file
remote: npm ERR! Missing: jest-worker@27.5.1 from lock file
remote: npm ERR! Invalid: lock file's schema-utils@1.0.0 does not satisfy schema-utils@3.1.1
remote: npm ERR! Missing: serialize-javascript@6.0.0 from lock file
remote: npm ERR! Invalid: lock file's terser@4.8.0 does not satisfy terser@5.14.1
remote: npm ERR! Missing: @jridgewell/resolve-uri@3.0.7 from lock file
remote: npm ERR! Missing: @jridgewell/sourcemap-codec@1.4.13 from lock file
remote: npm ERR! Missing: supports-color@8.1.1 from lock file
remote: npm ERR! Missing: @jridgewell/source-map@0.3.2 from lock file
remote: npm ERR! Missing: acorn@8.7.1 from lock file
remote: npm ERR! Invalid: lock file's commander@2.17.1 does not satisfy commander@2.20.3
remote: npm ERR! Invalid: lock file's source-map-support@0.5.20 does not satisfy source-map-support@0.5.21
remote: npm ERR! Missing: @jridgewell/gen-mapping@0.3.1 from lock file
remote: npm ERR! Missing: @jridgewell/set-array@1.1.1 from lock file
remote: npm ERR! Missing: glob-to-regexp@0.4.1 from lock file
remote: npm ERR! Missing: @webassemblyjs/ast@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/wasm-edit@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/wasm-parser@1.9.0 from lock file
remote: npm ERR! Missing: acorn@6.4.2 from lock file
remote: npm ERR! Missing: ajv-keywords@3.5.2 from lock file
remote: npm ERR! Missing: ajv@6.12.6 from lock file
remote: npm ERR! Missing: enhanced-resolve@4.5.0 from lock file
remote: npm ERR! Missing: eslint-scope@4.0.3 from lock file
remote: npm ERR! Missing: schema-utils@1.0.0 from lock file
remote: npm ERR! Missing: terser-webpack-plugin@1.4.5 from lock file
remote: npm ERR! Missing: watchpack@1.7.5 from lock file
remote: npm ERR! Missing: @webassemblyjs/ast@1.9.0 from lock file
remote: npm ERR! Missing: json-schema-traverse@0.4.1 from lock file
remote: npm ERR! Invalid: lock file's bn.js@5.2.0 does not satisfy bn.js@5.2.1
remote: npm ERR! Missing: @webassemblyjs/helper-wasm-bytecode@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/ast@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/floating-point-hex-parser@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/helper-api-error@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/wast-printer@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/helper-buffer@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/helper-wasm-section@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/wasm-gen@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/wasm-opt@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/wast-printer@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/ieee754@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/leb128@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/utf8@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/helper-api-error@1.9.0 from lock file
remote: npm ERR! Missing: memory-fs@0.5.0 from lock file
remote: npm ERR! Missing: find-cache-dir@2.1.0 from lock file
remote: npm ERR! Missing: is-wsl@1.1.0 from lock file
remote: npm ERR! Missing: source-map@0.6.1 from lock file
remote: npm ERR! Missing: terser@4.8.0 from lock file
remote: npm ERR! Missing: make-dir@2.1.0 from lock file
remote: npm ERR! Missing: pkg-dir@3.0.0 from lock file
remote: npm ERR! Missing: semver@5.7.1 from lock file
remote: npm ERR! Missing: find-up@3.0.0 from lock file
remote: npm ERR! Missing: locate-path@3.0.0 from lock file
remote: npm ERR! Missing: p-locate@3.0.0 from lock file
remote: npm ERR! Missing: loader-utils@1.4.0 from lock file
remote: npm ERR! Missing: loader-utils@1.4.0 from lock file
remote: npm ERR! Missing: loader-utils@0.2.17 from lock file
remote: npm ERR! Missing: commander@2.17.1 from lock file
remote: npm ERR! Invalid: lock file's css-select@4.1.3 does not satisfy css-select@4.3.0
remote: npm ERR! Invalid: lock file's css-what@5.1.0 does not satisfy css-what@6.1.0
remote: npm ERR! Invalid: lock file's domhandler@4.2.2 does not satisfy domhandler@4.3.1
remote: npm ERR! Invalid: lock file's nth-check@2.0.1 does not satisfy nth-check@2.1.1
remote: npm ERR! Invalid: lock file's dom-serializer@1.3.2 does not satisfy dom-serializer@1.4.1
remote: npm ERR! Missing: loader-utils@1.4.0 from lock file
remote: npm ERR! Missing: schema-utils@1.0.0 from lock file
remote: npm ERR! Missing: find-cache-dir@2.1.0 from lock file
remote: npm ERR! Missing: is-wsl@1.1.0 from lock file
remote: npm ERR! Missing: schema-utils@1.0.0 from lock file
remote: npm ERR! Missing: source-map@0.6.1 from lock file
remote: npm ERR! Missing: terser@4.8.0 from lock file
remote: npm ERR! Missing: loader-utils@1.4.0 from lock file
remote: npm ERR! Missing: loader-utils@1.4.0 from lock file
remote: npm ERR! Missing: mime@2.6.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/ast@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/wasm-edit@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/wasm-parser@1.9.0 from lock file
remote: npm ERR! Missing: acorn@6.4.2 from lock file
remote: npm ERR! Missing: enhanced-resolve@4.5.0 from lock file
remote: npm ERR! Missing: eslint-scope@4.0.3 from lock file
remote: npm ERR! Missing: loader-utils@1.4.0 from lock file
remote: npm ERR! Missing: schema-utils@1.0.0 from lock file
remote: npm ERR! Missing: watchpack@1.7.5 from lock file
remote: npm ERR! Missing: @webassemblyjs/helper-wasm-bytecode@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/helper-buffer@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/helper-wasm-section@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/wasm-gen@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/wasm-opt@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/wast-printer@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/ieee754@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/leb128@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/utf8@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/helper-api-error@1.9.0 from lock file
remote: npm ERR! Missing: memory-fs@0.5.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/ast@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/helper-wasm-bytecode@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/helper-wasm-bytecode@1.9.0 from lock file
remote: npm ERR! Missing: @webassemblyjs/helper-wasm-bytecode@1.9.0 from lock file
remote: npm ERR! Missing: has-flag@4.0.0 from lock file
remote: npm ERR! Missing: json5@1.0.1 from lock file
remote: npm ERR! Missing: json5@1.0.1 from lock file
remote: npm ERR! Missing: big.js@3.2.0 from lock file
remote: npm ERR! Missing: emojis-list@2.1.0 from lock file
remote: npm ERR! Missing: json5@0.5.1 from lock file
remote: npm ERR! Missing: json5@1.0.1 from lock file
remote: npm ERR! Missing: make-dir@2.1.0 from lock file
remote: npm ERR! Missing: pkg-dir@3.0.0 from lock file
remote: npm ERR! Missing: semver@5.7.1 from lock file
remote: npm ERR! Missing: find-up@3.0.0 from lock file
remote: npm ERR! Missing: locate-path@3.0.0 from lock file
remote: npm ERR! Missing: p-locate@3.0.0 from lock file
remote: npm ERR! Missing: json5@1.0.1 from lock file
remote: npm ERR! Missing: json5@1.0.1 from lock file
remote: npm ERR! Missing: json5@1.0.1 from lock file
remote: npm ERR!
remote: npm ERR! Clean install a project
remote: npm ERR!
remote: npm ERR! Usage:
remote: npm ERR! npm ci
remote: npm ERR!
remote: npm ERR! Options:
remote: npm ERR! [--no-audit] [--foreground-scripts] [--ignore-scripts]
remote: npm ERR! [--script-shell <script-shell>]
remote: npm ERR!
remote: npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
remote: npm ERR!
remote: npm ERR! Run "npm help ci" for more info
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.w2nFD/_logs/2022-06-23T14_38_57_792Z-debug-0.log
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: Some possible problems:
remote:
remote: - Node version not specified in package.json
remote: https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
这是我的包裹。Json文件看起来像:
{
"name": "words-project",
"version": "0.1.0",
"author": "isabelle",
"private": true,
"scripts": {
"start": "node ./bin/www",
"develop": "nodemon ./bin/www",
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@googlemaps/js-api-loader": "^1.12.9",
"@sendgrid/mail": "^7.6.0",
"@supercharge/strings": "^1.24.0",
"@vue/composition-api": "^1.4.1",
"animate.css": "4.1.1",
"axios": "^0.24.0",
"connect-history-api-fallback": "~1.6.0",
"cookie-parser": "~1.4.3",
"cors": "^2.8.5",
"debug": "~2.6.9",
"dotenv": "8.2.0",
"express": "^4.16.4",
"express-session": "^1.17.1",
"lodash": "^4.17.21",
"mongoose": "^5.11.13",
"mongoose-unique-validator": "^2.0.3",
"morgan": "~1.9.0",
"multer":"1.4.5-lts.1",
"nodemailer": "^6.7.2",
"nodemon": "^2.0.4",
"pdf-parse": "^1.1.1",
"pdfjs-dist": "2.5.207",
"sqlite3": "^5.0.0",
"vue": "^2.5.17",
"vue-cookie": "^1.1.4",
"vue-router": "^3.4.8",
"vuejs-datepicker":"1.6.2",
"vuetify": "^2.6.1"
},
"devDependencies": {
"@mdi/font": "^6.5.95",
"@vue/cli-plugin-babel": "^3.12.0",
"@vue/cli-service": "^4.5.8",
"deepmerge": "^4.2.2",
"jsdoc": "^3.6.7",
"jsdoc-http-plugin": "^0.3.2",
"jsdoc-to-markdown": "^7.1.0",
"resolve-url-loader": "^4.0.0",
"sass": "^1.32.13",
"sass-loader": "^12.3.0",
"vue-template-compiler": "^2.5.17"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"rules": {
"no-console": "off"
},
"parserOptions": {
"parser": "babel-eslint"
}
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
我一直在网上找,但似乎找不到任何答案。为什么heroku抛出这个错误?我以前部署过,没有问题。
尝试提交package-lock.json
(紧靠package.json
)文件并再次将代码推送到heroku