由于意外令牌,Circleci 构建失败
Circleci build fails due to Unexpected token
我刚接触 Jipster 和 CircleCi
我正在尝试为我的项目做 ci,但我的构建失败并出现以下错误:
node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js "--config" "webpack/webpack.prod.js" "--profile"
/home/circleci/repo/webpack/webpack.common.js:14
...rxPaths()
^^^
SyntaxError: Unexpected token ...
at NativeCompileCache._moduleCompile (/home/circleci/repo/node_modules/v8-compile-cache/v8-compile-c
抛出异常的代码:
resolve: {
extensions: ['.ts', '.js'],
modules: ['node_modules'],
alias: {
app: utils.root('src/main/webapp/app/'),
...rxPaths()(this is line 14)
}
}
我安装节点的config.yml行
# Install Node for JH Build
- run:
name: Download Node
command: curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash
- run:
name: Install Node
command: sudo apt-get install -y nodejs
- run:
name: update-npm
command: sudo npm install -g npm@latest
# Install Yarn
- run:
name: Download Yarn
command: curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add && echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- run:
name: Install Yarn
command: sudo apt-get update && sudo apt-get install yarn
每次构建运行时我都会安装节点。
我使用 JHipster v5.4.1
编辑:我添加了 config.yml
@anvk 表示问题出在节点版本中。
我将版本升级到 10 并且有效。
我刚接触 Jipster 和 CircleCi 我正在尝试为我的项目做 ci,但我的构建失败并出现以下错误:
node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js "--config" "webpack/webpack.prod.js" "--profile"
/home/circleci/repo/webpack/webpack.common.js:14
...rxPaths()
^^^
SyntaxError: Unexpected token ...
at NativeCompileCache._moduleCompile (/home/circleci/repo/node_modules/v8-compile-cache/v8-compile-c
抛出异常的代码:
resolve: {
extensions: ['.ts', '.js'],
modules: ['node_modules'],
alias: {
app: utils.root('src/main/webapp/app/'),
...rxPaths()(this is line 14)
}
}
我安装节点的config.yml行
# Install Node for JH Build
- run:
name: Download Node
command: curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash
- run:
name: Install Node
command: sudo apt-get install -y nodejs
- run:
name: update-npm
command: sudo npm install -g npm@latest
# Install Yarn
- run:
name: Download Yarn
command: curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add && echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- run:
name: Install Yarn
command: sudo apt-get update && sudo apt-get install yarn
每次构建运行时我都会安装节点。 我使用 JHipster v5.4.1
编辑:我添加了 config.yml
@anvk 表示问题出在节点版本中。 我将版本升级到 10 并且有效。