我一直在尝试使用circle ci和create react应用程序,但我遇到了这个错误。
#!/bin/bash -eo pipefail
CI=true npm run build> react-scripts build
/home/circleci/project/node_modules/react-scripts/node_modules/fs-extra/lib/mkdirs/make-dir.js:85
} catch {
^
SyntaxError: Unexpected token {
at new Script (vm.js:51:7)
at createScript (vm.js:136:10)
at Object.runInThisContext (vm.js:197:10)
at Module._compile (module.js:613:28)
at Object.Module._extensions..js (module.js:660:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:501:12)
at Function.Module._load (module.js:493:3)
at Module.require (module.js:593:17)
at require (internal/module.js:11:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! robofriends@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the robofriends@0.1.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! /home/circleci/.npm/_logs/2021-09-24T23_47_26_734Z-debug.log
Exited with code exit status 1
CircleCI received exit code 1这些是我的简单设置。
# .circleci/config.yml
version: 2.1
jobs:
build:
docker:
- image: circleci/node:9.8
steps:
- checkout
- run: echo "npm installing"
- run: npm install
- run: CI=true npm run build// package.json
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-redux": "^7.2.4",
"react-scripts": "^4.0.3"有谁知道为什么会出现这个错误吗?这是关于节点版本还是别的什么?
发布于 2021-10-05 22:21:30
我已经将节点映像更改为最新版本,并且它起作用了!
- image: circleci/node:latest
https://stackoverflow.com/questions/69322131
复制相似问题