Я пытаюсь развернуть приложение js для узла в Heroku, но оно продолжает давать сбой.
Я уже установил NPM_CONFIG_PRODUCTION=false
. Скрипт сборки отлично работает на моей локальной машине
Это мой файл package.json
"release": "npm run clean && npm run build-app && npm run start",
"clean": "rm -rf dist && mkdir dist",
"build": "rm -rf ./dist && mkdir dist && babel . --out-dir dist",
"build-app": "babel . -s -d dist --presets=@babel/env --ignore node_modules",
Сборка должна быть успешной, но это ошибка, которую я получаю на Heroku
> rm -rf ./dist && mkdir dist && babel . --out-dir dist
[BABEL] Note: The code generator has deoptimised the styling of /tmp/build_3a8af19f4cfbd2b3f05ba2bc3775012d/.heroku/node/lib/node_modules/npm/node_modules/ajv/dist/regenerator.min.js as it exceeds the max of 500KB.
{ SyntaxError: /tmp/build_3a8af19f4cfbd2b3f05ba2bc3775012d/.heroku/node/lib/node_modules/npm/node_modules/cmd-shim/index.js: Legacy octal literals are not allowed in strict mode (166:15)
164 | function chmodShim (to, cb) {
165 | var then = times(2, cb, cb)
> 166 | fs.chmod(to, 0755, then)
| ^
167 | fs.chmod(to + ".cmd", 0755, then)
168 | }
169 |
at Parser.raise (/tmp/build_3a8af19f4cfbd2b3f05ba2bc3775012d/node_modules/@babel/parser/lib/index.js:3851:17)
at Parser.readNumber (/tmp/build_3a8af19f4cfbd2b3f05ba2bc3775012d/node_modules/@babel/parser/lib/index.js:4702:14)
at Parser.getTokenFromCode (/tmp/build_3a8af19f4cfbd2b3f05ba2bc3775012d/node_modules/@babel/parser/lib/index.js:4474:14)
at Parser.nextToken (/tmp/build_3a8af19f4cfbd2b3f05ba2bc3775012d/node_modules/@babel/parser/lib/index.js:4049:12)
at Parser.next (/tmp/build_3a8af19f4cfbd2b3f05ba2bc3775012d/node_modules/@babel/parser/lib/index.js:3989:10)
at Parser.eat (/tmp/build_3a8af19f4cfbd2b3f05ba2bc3775012d/node_modules/@babel/parser/lib/index.js:3994:12)
at Parser.expect (/tmp/build_3a8af19f4cfbd2b3f05ba2bc3775012d/node_modules/@babel/parser/lib/index.js:5153:10)
at Parser.parseCallExpressionArguments (/tmp/build_3a8af19f4cfbd2b3f05ba2bc3775012d/node_modules/@babel/parser/lib/index.js:6106:14)
at Parser.parseSubscript (/tmp/build_3a8af19f4cfbd2b3f05ba2bc3775012d/node_modules/@babel/parser/lib/index.js:6016:29)
at Parser.parseSubscripts (/tmp/build_3a8af19f4cfbd2b3f05ba2bc3775012d/node_modules/@babel/parser/lib/index.js:5935:19)
pos: 4390,
loc: Position { line: 166, column: 15 },
code: 'BABEL_PARSE_ERROR' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! banka@1.0.0 build: `rm -rf ./dist && mkdir dist && babel . --out-dir dist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the banka@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.zXFlw/_logs/2019-04-19T07_15_46_065Z-debug.log
-----> Build failed