我已经安装了Angular 8,并且在GitHub Actions中构建应用程序时遇到下一个错误。
ERROR in main-es2015.e1115c7c82627ce27910.js from Terser
TypeError: Cannot read property 'variables' of undefined
at /app/node_modules/terser-webpack-plugin/node_modules/terser/dist/bundle.min.js:1:209686
at /app/node_modules/terser-webpack-plugin/node_modules/terser/dist/bundle.min.js:1:211321
at AST_Call.optimize (/app/node_modules/terser-webpack-plugin/node_modules/terser/dist/bundle.min.js:1:137138)
at ri.before (/app/node_modules/terser-webpack-plugin/node_modules/terser/dist/bundle.min.js:1:136915)
at AST_Call.transform (/app/node_modules/terser-webpack-plugin/node_modules/terser/dist/bundle.min.js:1:84111)
at /app/node_modules/terser-webpack-plugin/node_modules/terser/dist/bundle.min.js:1:84275
at l (/app/node_modules/terser-webpack-plugin/node_modules/terser/dist/bundle.min.js:1:931)
at e (/app/node_modules/terser-webpack-plugin/node_modules/terser/dist/bundle.min.js:1:1251)
at Nn (/app/node_modules/terser-webpack-plugin/node_modules/terser/dist/bundle.min.js:1:84249)
at /app/node_modules/terser-webpack-plugin/node_modules/terser/dist/bundle.min.js:1:86559
at ri.before (/app/node_modules/terser-webpack-plugin/node_modules/terser/dist/bundle.min.js:1:136887)
at AST_Sequence.transform (/app/node_modules/terser-webpack-plugin/node_modules/terser/dist/bundle.min.js:1:84111)
at /app/node_modules/terser-webpack-plugin/node_modules/terser/dist/bundle.min.js:1:84817
at ri.before (/app/node_modules/terser-webpack-plugin/node_modules/terser/dist/bundle.min.js:1:136887)
at AST_SimpleStatement.transform (/app/node_modules/terser-webpack-plugin/node_modules/terser/dist/bundle.min.js:1:84111)
at /app/node_modules/terser-webpack-plugin/node_modules/terser/dist/bundle.min.js:1:84275
npm ERR! code ELIFECYCLE
npm ERR! errno 1
我的dockerfile是
FROM node:11.15.0-alpine as build-step
WORKDIR /app
COPY package.json ./
RUN npm install
COPY . .
RUN npm run build -- --configuration=production
FROM nginx:alpine-perl as prod-stage
COPY docker/nginx/default.conf.template /etc/nginx/conf.d/default.conf.template
RUN rm -rf /usr/share/nginx/html/*
COPY --from=build-step app/dist/AppName /usr/share/nginx/html
## startup.sh script is launched at container run
CMD /bin/sh -c "envsubst '\$PORT' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf" && nginx -g 'daemon off;'
我不知道问题出在哪里,可能是由安装ng-spinner引起的吗?
答案 0 :(得分:0)
好吧,问题是我安装了最新版本的ngx-spinner(v9.0.1),但我使用的是Angular 8,我需要ngx-spinner(v8.0.1)
我希望此解决方案可以帮助另一个人