CircleCI-Public / circleci-cli

Use CircleCI from the command line
https://circleci-public.github.io/circleci-cli/
MIT License
410 stars 232 forks source link

Failed to npx command only in the `circleci local execute` and CircleCI service. #270

Closed ryo-yamaoka closed 5 years ago

ryo-yamaoka commented 5 years ago

Do you want to request a feature or report a bug?

bug (?)

What is the current behavior?

npx react-scripts build command failed.

This issue is occurring only in the circleci local execute and CircleCI service environment.

It is not occurring in my local PC execute and hand operation (copy & paste command from .circleci/config.yml) in docker container run -it xxx /bin/bash.

What is the expected behavior?

success npx command in the circleci local execute and CircleCI service environment.

Which version of the CLI and OS are you using? Did this work in previous versions?

$ circleci version
0.1.5294+2123983
$ 
$ circleci diagnostic

---
CircleCI CLI Diagnostics
---
Debugger mode: false
Config found: /home/ca/.circleci/cli.yml
API host: https://circleci.com
API endpoint: graphql-unstable
Error: please set a token with 'circleci setup'
You can create a new personal API token here:
https://circleci.com/account/api

And don't work in previous versions.

If you have any questions, feel free to ping us at @CircleCI-Public/dx-clients.

Please tell me what different between docker run and circleci local execute environment.

eric-hu commented 5 years ago

Hi @ryo-yamaoka , is it possible for you to you share your .circleci/config.yml or a simple config that reproduces the issue? There currently isn't enough information for me to reproduce this. It sounds like npx runs inside of a Docker container, but it's unclear what the Docker container is.

ryo-yamaoka commented 5 years ago

Thanks for response, and sorry for lack information.

It is faied to npm run build . I executed npx react-scripts build for break down issue, then it's failed. However, this issue isn't occur in the docker run -it mercari/appengine-go:1.9 /bin/bash environment by hand operation. In addition to that I tried same operation another container environment, but it isn't occur to same. (for ex. circleci/golang:1.9, golang:1.9, etc...)

.circleci/config.yml ```yml version: 2 jobs: build: parallelism: 1 working_directory: /go/src/github.com/myrepo/myapp_gae/ docker: - image: mercari/appengine-go:1.9 environment: GOPATH: /go INSTALL_DIRECTORY: /usr/bin # for dep install steps: - checkout - run: name: Install dep command command: curl -s https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - restore_cache: key: vendor-{{ checksum "Gopkg.lock" }} - run: name: Install dependent libraries command: dep ensure -vendor-only -v - save_cache: key: vendor-{{ checksum "Gopkg.lock" }} paths: - vendor - run: name: Install Node.js command: | curl -sL https://deb.nodesource.com/setup_9.x | bash apt update -y apt install nodejs -y npm install -g n n 9.11.1 node -v - run: name: Frontend build command: | cd src/myapp/ node -v npm install npm run build --loglevel silly ```
package.json ```json { "name": "myapp", "version": "0.1.0", "private": true, "dependencies": { "@fortawesome/fontawesome-free": "5.5.0", "history": "4.7.2", "js-cookie": "2.2.0", "jwt-decode": "2.2.0", "react": "16.6.3", "react-dom": "16.6.3", "react-helmet": "5.2.0", "react-placeholder": "2.0.0", "react-redux": "5.0.6", "react-router-dom": "4.2.2", "react-router-redux": "5.0.0-alpha.9", "react-toastify": "3.3.2", "redux": "3.7.2", "redux-logger": "3.0.6", "redux-thunk": "2.2.0", "spectre.css": "0.5.0", "superagent": "3.8.2" }, "scripts": { "build": "npm run build-css && npm run build-js", "start": "npm-run-all -p start-css start-js", "start-js": "react-scripts start", "build-js": "react-scripts build", "build-css": "node-sass-chokidar ./src/scss/App.scss ./src/App.css", "start-css": "npm run build-css && node-sass-chokidar ./src/scss/App.scss ./src/App.css -w -r", "build-clean": "rm ~/.appcfg_*", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject" }, "devDependencies": { "eslint": "5.9.0", "eslint-plugin-react": "7.11.1", "node-sass-chokidar": "1.3.4", "npm-run-all": "4.1.5", "react-scripts": "1.1.0" } } ```
full log (circleci local execute) ```bash $ circleci local execute Docker image digest: sha256:0ae15d9b8329446dd5d241b1d654774871caa89c1cc47d513063c23037aae917 ====>> Spin up Environment Build-agent version 0.1.1099-5b3eca5b (2018-11-23T19:35:18+0000) Starting container mercari/appengine-go:1.9 using image mercari/appengine-go@sha256:4f8abf3697f7fe86100932ee7856d75ac2bb92b6f4c241dccec51aa3b0e24564 Using build environment variables: BASH_ENV=/tmp/.bash_env-localbuild-1549505152 CI=true CIRCLECI=true CIRCLE_BRANCH=master CIRCLE_BUILD_NUM= CIRCLE_JOB=build CIRCLE_NODE_INDEX=0 CIRCLE_NODE_TOTAL=1 CIRCLE_REPOSITORY_URL=git@github.com:myrepo/myapp_gae.git CIRCLE_SHA1=ba35702d7d2fb935f9bce9007bba3c930f350e38 CIRCLE_SHELL_ENV=/tmp/.bash_env-localbuild-1549505152 CIRCLE_WORKING_DIRECTORY=/go/src/github.com/myrepo/myapp_gae/ ====>> Checkout code #!/bin/bash -eo pipefail mkdir -p /go/src/github.com/myrepo/myapp_gae && cp -r /tmp/_circleci_local_build_repo/. /go/src/github.com/myrepo/myapp_gae ====>> Install dep command #!/bin/bash -eo pipefail curl -s https://raw.githubusercontent.com/golang/dep/master/install.sh | sh ARCH = amd64 OS = linux Will install into /usr/bin Fetching https://github.com/golang/dep/releases/latest.. Release Tag = v0.5.0 Fetching https://github.com/golang/dep/releases/tag/v0.5.0.. Fetching https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64.. Setting executable permissions. Moving executable to /usr/bin/dep ====>> Restoring Cache Error: Skipping cache - error checking storage: not supported Step failed ====>> Install dependency liblaries #!/bin/bash -eo pipefail dep ensure -vendor-only -v (1/36) Wrote github.com/mattn/go-isatty@v0.0.3 (2/36) Wrote gopkg.in/go-playground/validator.v9@v9.24.0 (3/36) Wrote github.com/satori/go.uuid@v1.2.0 (4/36) Wrote golang.org/x/sync@master (5/36) Wrote github.com/nfnt/resize@master (6/36) Wrote github.com/mjibson/goon@master (7/36) Wrote google.golang.org/genproto@master (8/36) Wrote github.com/olahol/go-imageupload@master (9/36) Wrote google.golang.org/appengine@master (10/36) Wrote github.com/valyala/fasttemplate@master (11/36) Wrote golang.org/x/text@v0.3.0 (12/36) Wrote golang.org/x/sys@master (13/36) Wrote go.opencensus.io@v0.15.0 (14/36) Wrote golang.org/x/oauth2@master (15/36) Wrote golang.org/x/net@master (16/36) Wrote golang.org/x/crypto@master (17/36) Wrote github.com/PuerkitoBio/purell@v1.1.0 (18/36) Wrote google.golang.org/api@master (19/36) Wrote github.com/favclip/testerator@master (20/36) Wrote github.com/valyala/bytebufferpool@master (21/36) Wrote github.com/go-playground/universal-translator@v0.16.0 (22/36) Wrote google.golang.org/grpc@v1.14.0 (23/36) Wrote github.com/googleapis/gax-go@v2.0.0 (24/36) Wrote github.com/PuerkitoBio/urlesc@master (25/36) Wrote cloud.google.com/go@v0.26.0 (26/36) Wrote github.com/labstack/echo@v3.3.5 (27/36) Wrote github.com/PuerkitoBio/goquery@v1.4.1 (28/36) Wrote github.com/andybalholm/cascadia@v1.0.0 (29/36) Wrote github.com/mattn/go-colorable@v0.0.9 (30/36) Wrote github.com/leodido/go-urn@v1.1.0 (31/36) Wrote github.com/dgrijalva/jwt-go@v3.2.0 (32/36) Wrote github.com/disintegration/gift@v1.1.2 (33/36) Wrote github.com/labstack/gommon@0.2.6 (34/36) Wrote contrib.go.opencensus.io/exporter/stackdriver@v0.6.0 (35/36) Wrote github.com/golang/protobuf@v1.2.0 (36/36) Wrote github.com/go-playground/locales@v0.12.1 ====>> Saving Cache Error: Skipping cache - error checking storage: not supported Step failed ====>> Install Node.js #!/bin/bash -eo pipefail curl -sL https://deb.nodesource.com/setup_9.x | bash apt update -y apt install nodejs -y npm install -g n n 9.11.1 node -v tput: No value for $TERM and no -T specified ## Installing the NodeSource Node.js 9.x repo... ## Populating apt-get cache... + apt-get update Get:1 http://security.debian.org jessie/updates InRelease [44.9 kB] Ign http://httpredir.debian.org jessie InRelease Get:2 http://httpredir.debian.org jessie-updates InRelease [145 kB] Get:3 http://security.debian.org jessie/updates/main amd64 Packages [802 kB] Get:4 http://httpredir.debian.org jessie Release.gpg [2420 B] Get:5 http://httpredir.debian.org jessie-updates/main amd64 Packages [23.0 kB] Get:6 http://httpredir.debian.org jessie Release [148 kB] Get:7 http://httpredir.debian.org jessie/main amd64 Packages [9098 kB] Fetched 10.3 MB in 4s (2559 kB/s) Reading package lists... Done ## Installing packages required for setup: apt-transport-https lsb-release... + apt-get install -y apt-transport-https lsb-release > /dev/null 2>&1 ## You seem to be using Devuan version jessie. ## This maps to Debian "jessie"... Adjusting for you... ## Confirming "jessie" is supported... + curl -sLf -o /dev/null 'https://deb.nodesource.com/node_9.x/dists/jessie/Release' ## Adding the NodeSource signing key to your keyring... + curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - OK ## Creating apt sources list file for the NodeSource Node.js 9.x repo... + echo 'deb https://deb.nodesource.com/node_9.x jessie main' > /etc/apt/sources.list.d/nodesource.list + echo 'deb-src https://deb.nodesource.com/node_9.x jessie main' >> /etc/apt/sources.list.d/nodesource.list ## Running `apt-get update` for you... + apt-get update Get:1 https://deb.nodesource.com jessie InRelease [4622 B] Hit http://security.debian.org jessie/updates InRelease Get:2 https://deb.nodesource.com jessie/main Sources [20 B] Get:3 https://deb.nodesource.com jessie/main amd64 Packages [765 B] Get:4 http://security.debian.org jessie/updates/main amd64 Packages [802 kB] Ign http://httpredir.debian.org jessie InRelease Hit http://httpredir.debian.org jessie-updates InRelease Hit http://httpredir.debian.org jessie Release.gpg Get:5 http://httpredir.debian.org jessie-updates/main amd64 Packages [23.0 kB] Hit http://httpredir.debian.org jessie Release Get:6 http://httpredir.debian.org jessie/main amd64 Packages [9098 kB] Fetched 9928 kB in 4s (2328 kB/s) Reading package lists... Done ## Run `sudo apt-get install -y nodejs` to install Node.js 9.x and npm ## You may also need development tools to build native addons: sudo apt-get install gcc g++ make ## To install the Yarn package manager, run: curl -sL 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 sudo apt-get update && sudo apt-get install yarn Hit https://deb.nodesource.com jessie InRelease Get:1 https://deb.nodesource.com jessie/main Sources [20 B] Hit http://security.debian.org jessie/updates InRelease Get:2 https://deb.nodesource.com jessie/main amd64 Packages [765 B] Get:3 http://security.debian.org jessie/updates/main amd64 Packages [802 kB] Ign http://httpredir.debian.org jessie InRelease Hit http://httpredir.debian.org jessie-updates InRelease Hit http://httpredir.debian.org jessie Release.gpg Get:4 http://httpredir.debian.org jessie-updates/main amd64 Packages [23.0 kB] Hit http://httpredir.debian.org jessie Release Get:5 http://httpredir.debian.org jessie/main amd64 Packages [9098 kB] Fetched 9924 kB in 3s (2498 kB/s) Reading package lists... Done Building dependency tree Reading state information... Done 35 packages can be upgraded. Run 'apt list --upgradable' to see them. Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: nodejs 0 upgraded, 1 newly installed, 0 to remove and 35 not upgraded. Need to get 12.8 MB of archives. After this operation, 62.5 MB of additional disk space will be used. Get:1 https://deb.nodesource.com/node_9.x/ jessie/main nodejs amd64 9.11.2-1nodesource1 [12.8 MB] Fetched 12.8 MB in 0s (14.9 MB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package nodejs. (Reading database ... 16107 files and directories currently installed.) Preparing to unpack .../nodejs_9.11.2-1nodesource1_amd64.deb ... Unpacking nodejs (9.11.2-1nodesource1) ... Setting up nodejs (9.11.2-1nodesource1) ... /usr/bin/n -> /usr/lib/node_modules/n/bin/n + n@2.1.12 added 1 package in 0.35s install : node-v9.11.1 mkdir : /usr/local/n/versions/node/9.11.1 fetch : https://nodejs.org/dist/v9.11.1/node-v9.11.1-linux-x64.tar.gz ######################################################################## 100.0% installed : v9.11.1 v9.11.1 ====>> Frontend build #!/bin/bash -eo pipefail cd src/myapp/ node -v npm install npm run build --loglevel silly v9.11.1 npm WARN eslint-config-react-app@2.1.0 requires a peer of eslint@^4.1.1 but none is installed. You must install peer dependencies yourself. npm WARN eslint-loader@1.9.0 requires a peer of eslint@>=1.6.0 <5.0.0 but none is installed. You must install peer dependencies yourself. npm WARN eslint-plugin-import@2.8.0 requires a peer of eslint@2.x - 4.x but none is installed. You must install peer dependencies yourself. npm WARN eslint-plugin-jsx-a11y@5.1.1 requires a peer of eslint@^2.10.2 || ^3 || ^4 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/react-scripts/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) up to date in 8.961s npm info it worked if it ends with ok npm verb cli [ '/usr/local/bin/node', npm verb cli '/usr/local/bin/npm', npm verb cli 'run', npm verb cli 'build', npm verb cli '--loglevel', npm verb cli 'silly' ] npm info using npm@5.6.0 npm info using node@v9.11.1 npm verb run-script [ 'prebuild', 'build', 'postbuild' ] npm info lifecycle myapp@0.1.0~prebuild: myapp@0.1.0 npm info lifecycle myapp@0.1.0~build: myapp@0.1.0 > myapp@0.1.0 build /go/src/github.com/myrepo/myapp_gae/src/myapp > npm run build-css && npm run build-js npm info it worked if it ends with ok npm verb cli [ '/usr/local/bin/node', npm verb cli '/usr/local/bin/npm', npm verb cli 'run', npm verb cli 'build-css' ] npm info using npm@5.6.0 npm info using node@v9.11.1 npm verb run-script [ 'prebuild-css', 'build-css', 'postbuild-css' ] npm info lifecycle myapp@0.1.0~prebuild-css: myapp@0.1.0 npm info lifecycle myapp@0.1.0~build-css: myapp@0.1.0 > myapp@0.1.0 build-css /go/src/github.com/myrepo/myapp_gae/src/myapp > node-sass-chokidar ./src/scss/App.scss ./src/App.css Rendering Complete, saving .css file... Wrote CSS to /go/src/github.com/myrepo/myapp_gae/src/myapp/src/App.css npm verb lifecycle myapp@0.1.0~build-css: unsafe-perm in lifecycle true npm verb lifecycle myapp@0.1.0~build-css: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/go/src/github.com/myrepo/myapp_gae/src/myapp/node_modules/.bin:/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/go/src/github.com/myrepo/myapp_gae/src/myapp/node_modules/.bin:/go/bin:/usr/local/go/bin:/usr/lib/google-cloud-sdk/bin:/usr/lib/google-cloud-sdk/platform/google_appengine:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin npm verb lifecycle myapp@0.1.0~build-css: CWD: /go/src/github.com/myrepo/myapp_gae/src/myapp npm sill lifecycle myapp@0.1.0~build-css: Args: [ '-c', 'node-sass-chokidar ./src/scss/App.scss ./src/App.css' ] npm sill lifecycle myapp@0.1.0~build-css: Returned: code: 0 signal: null npm info lifecycle myapp@0.1.0~postbuild-css: myapp@0.1.0 npm verb exit [ 0, true ] npm info ok npm info it worked if it ends with ok npm verb cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'build-js' ] npm info using npm@5.6.0 npm info using node@v9.11.1 npm verb run-script [ 'prebuild-js', 'build-js', 'postbuild-js' ] npm info lifecycle myapp@0.1.0~prebuild-js: myapp@0.1.0 npm info lifecycle myapp@0.1.0~build-js: myapp@0.1.0 > myapp@0.1.0 build-js /go/src/github.com/myrepo/myapp_gae/src/myapp > react-scripts build Creating an optimized production build... Treating warnings as errors because process.env.CI = true. Most CI servers set it automatically. Failed to compile. ./src/pages/GoodByePage/GoodByePage.js Line 10: 'Cookies' is defined but never used no-unused-vars ./src/components/AvatarUploadForm.js Line 119: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text ./src/components/ItemImage.js Line 12: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text ./src/components/FeedImage.js Line 14: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text ./src/components/Avatar.js Line 16: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text ./src/pages/TimelinePage/TimelinePage.js Line 25: Do not mutate state directly. Use setState() react/no-direct-mutation-state ./src/components/ScrollContainer.js Line 39: Do not mutate state directly. Use setState() react/no-direct-mutation-state ./src/components/Navbar.js Line 39: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text ./src/pages/LandingPage/LandingPage.js Line 54: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text ./src/App.css (Emitted value instead of an instance of Error) autoprefixer: /go/src/github.com/myrepo/myapp_gae/src/myapp/src/App.css:3076:5: Second Autoprefixer control comment was ignored. Autoprefixer applies control comment to whole block, not to next rules. npm verb lifecycle myapp@0.1.0~build-js: unsafe-perm in lifecycle true npm verb lifecycle myapp@0.1.0~build-js: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/go/src/github.com/myrepo/myapp_gae/src/myapp/node_modules/.bin:/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/go/src/github.com/myrepo/myapp_gae/src/myapp/node_modules/.bin:/go/bin:/usr/local/go/bin:/usr/lib/google-cloud-sdk/bin:/usr/lib/google-cloud-sdk/platform/google_appengine:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin npm verb lifecycle myapp@0.1.0~build-js: CWD: /go/src/github.com/myrepo/myapp_gae/src/myapp npm sill lifecycle myapp@0.1.0~build-js: Args: [ '-c', 'react-scripts build' ] npm sill lifecycle myapp@0.1.0~build-js: Returned: code: 1 signal: null npm info lifecycle myapp@0.1.0~build-js: Failed to exec build-js script npm verb stack Error: myapp@0.1.0 build-js: `react-scripts build` npm verb stack Exit status 1 npm verb stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16) npm verb stack at EventEmitter.emit (events.js:180:13) npm verb stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) npm verb stack at ChildProcess.emit (events.js:180:13) npm verb stack at maybeClose (internal/child_process.js:936:16) npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5) npm verb pkgid myapp@0.1.0 npm verb cwd /go/src/github.com/myrepo/myapp_gae/src/myapp npm verb Linux 4.15.0-45-generic npm verb argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build-js" npm verb node v9.11.1 npm verb npm v5.6.0 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! myapp@0.1.0 build-js: `react-scripts build` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the myapp@0.1.0 build-js script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm verb exit [ 1, true ] npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2019-02-07T02_07_40_070Z-debug.log npm verb lifecycle myapp@0.1.0~build: unsafe-perm in lifecycle true npm verb lifecycle myapp@0.1.0~build: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/go/src/github.com/myrepo/myapp_gae/src/myapp/node_modules/.bin:/go/bin:/usr/local/go/bin:/usr/lib/google-cloud-sdk/bin:/usr/lib/google-cloud-sdk/platform/google_appengine:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin npm verb lifecycle myapp@0.1.0~build: CWD: /go/src/github.com/myrepo/myapp_gae/src/myapp npm sill lifecycle myapp@0.1.0~build: Args: [ '-c', 'npm run build-css && npm run build-js' ] npm sill lifecycle myapp@0.1.0~build: Returned: code: 1 signal: null npm info lifecycle myapp@0.1.0~build: Failed to exec build script npm verb stack Error: myapp@0.1.0 build: `npm run build-css && npm run build-js` npm verb stack Exit status 1 npm verb stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16) npm verb stack at EventEmitter.emit (events.js:180:13) npm verb stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) npm verb stack at ChildProcess.emit (events.js:180:13) npm verb stack at maybeClose (internal/child_process.js:936:16) npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5) npm verb pkgid myapp@0.1.0 npm verb cwd /go/src/github.com/myrepo/myapp_gae/src/myapp npm verb Linux 4.15.0-45-generic npm verb argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build" "--loglevel" "silly" npm verb node v9.11.1 npm verb npm v5.6.0 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! myapp@0.1.0 build: `npm run build-css && npm run build-js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the myapp@0.1.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm verb exit [ 1, true ] npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2019-02-07T02_07_40_084Z-debug.log Error: Exited with code 1 Step failed Error: runner failed {"Runner":true,"level":"error","msg":"runner failed","task-id":"localbuild-1549505152","time":"2019-02-07T02:07:40Z"} Task failed Error: job failed ```
full log (hand operation) ```bash $ docker run -it mercari/appengine-go:1.9 /bin/bash root@a46e0bbaa8e7:/# root@a46e0bbaa8e7:/# export GOPATH=/go root@a46e0bbaa8e7:/# export INSTALL_DIRECTORY=/usr/bin root@a46e0bbaa8e7:/# mkdir -p /go/src/github.com/myrepo/ root@a46e0bbaa8e7:/# cd /go/src/github.com/myrepo/ root@a46e0bbaa8e7:/go/src/github.com/myrepo# git clone git@github.com:myrepo/myapp_gae.git Cloning into 'myapp_gae'... remote: Enumerating objects: 589, done. remote: Counting objects: 100% (589/589), done. remote: Compressing objects: 100% (295/295), done. remote: Total 14690 (delta 375), reused 425 (delta 257), pack-reused 14101 Receiving objects: 100% (14690/14690), 14.21 MiB | 8.67 MiB/s, done. Resolving deltas: 100% (8929/8929), done. Checking connectivity... done. root@a46e0bbaa8e7:/go/src/github.com/myrepo# root@a46e0bbaa8e7:/go/src/github.com/myrepo# cd myapp_gae/ root@a46e0bbaa8e7:/go/src/github.com/myrepo/myapp_gae# curl -s https://raw.githubusercontent.com/golang/dep/master/install.sh | sh ARCH = amd64 OS = linux Will install into /usr/bin Fetching https://github.com/golang/dep/releases/latest.. Release Tag = v0.5.0 Fetching https://github.com/golang/dep/releases/tag/v0.5.0.. Fetching https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64.. Setting executable permissions. Moving executable to /usr/bin/dep root@a46e0bbaa8e7:/go/src/github.com/myrepo/myapp_gae# dep ensure -vendor-only -v (1/36) Wrote github.com/mattn/go-isatty@v0.0.3 (2/36) Wrote github.com/olahol/go-imageupload@master (3/36) Wrote github.com/dgrijalva/jwt-go@v3.2.0 (4/36) Wrote golang.org/x/sys@master (5/36) Wrote github.com/PuerkitoBio/goquery@v1.4.1 (6/36) Wrote github.com/andybalholm/cascadia@v1.0.0 (7/36) Wrote github.com/satori/go.uuid@v1.2.0 (8/36) Wrote golang.org/x/sync@master (9/36) Wrote contrib.go.opencensus.io/exporter/stackdriver@v0.6.0 (10/36) Wrote gopkg.in/go-playground/validator.v9@v9.24.0 (11/36) Wrote github.com/favclip/testerator@master (12/36) Wrote github.com/nfnt/resize@master (13/36) Wrote github.com/PuerkitoBio/purell@v1.1.0 (14/36) Wrote github.com/disintegration/gift@v1.1.2 (15/36) Wrote cloud.google.com/go@v0.26.0 (16/36) Wrote github.com/mjibson/goon@master (17/36) Wrote github.com/PuerkitoBio/urlesc@master (18/36) Wrote golang.org/x/text@v0.3.0 (19/36) Wrote github.com/valyala/bytebufferpool@master (20/36) Wrote github.com/googleapis/gax-go@v2.0.0 (21/36) Wrote github.com/go-playground/universal-translator@v0.16.0 (22/36) Wrote github.com/valyala/fasttemplate@master (23/36) Wrote google.golang.org/genproto@master (24/36) Wrote github.com/golang/protobuf@v1.2.0 (25/36) Wrote golang.org/x/crypto@master (26/36) Wrote golang.org/x/oauth2@master (27/36) Wrote github.com/labstack/gommon@0.2.6 (28/36) Wrote github.com/leodido/go-urn@v1.1.0 (29/36) Wrote github.com/labstack/echo@v3.3.5 (30/36) Wrote go.opencensus.io@v0.15.0 (31/36) Wrote github.com/go-playground/locales@v0.12.1 (32/36) Wrote github.com/mattn/go-colorable@v0.0.9 (33/36) Wrote google.golang.org/grpc@v1.14.0 (34/36) Wrote google.golang.org/appengine@master (35/36) Wrote golang.org/x/net@master (36/36) Wrote google.golang.org/api@master # curl -sL https://deb.nodesource.com/setup_9.x | bash ## Installing the NodeSource Node.js 9.x repo... ## Populating apt-get cache... + apt-get update Hit http://security.debian.org jessie/updates InRelease Ign http://httpredir.debian.org jessie InRelease Hit http://httpredir.debian.org jessie-updates InRelease Hit http://httpredir.debian.org jessie Release.gpg Hit http://httpredir.debian.org jessie Release Get:1 http://security.debian.org jessie/updates/main amd64 Packages [802 kB] Get:2 http://httpredir.debian.org jessie-updates/main amd64 Packages [23.0 kB] Get:3 http://httpredir.debian.org jessie/main amd64 Packages [9098 kB] Fetched 9923 kB in 7s (1290 kB/s) Reading package lists... Done ## Installing packages required for setup: apt-transport-https lsb-release... + apt-get install -y apt-transport-https lsb-release > /dev/null 2>&1 ## You seem to be using Devuan version jessie. ## This maps to Debian "jessie"... Adjusting for you... ## Confirming "jessie" is supported... + curl -sLf -o /dev/null 'https://deb.nodesource.com/node_9.x/dists/jessie/Release' ## Adding the NodeSource signing key to your keyring... + curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - OK ## Creating apt sources list file for the NodeSource Node.js 9.x repo... + echo 'deb https://deb.nodesource.com/node_9.x jessie main' > /etc/apt/sources.list.d/nodesource.list + echo 'deb-src https://deb.nodesource.com/node_9.x jessie main' >> /etc/apt/sources.list.d/nodesource.list ## Running `apt-get update` for you... + apt-get update Get:1 https://deb.nodesource.com jessie InRelease [4622 B] Hit http://security.debian.org jessie/updates InRelease Ign http://httpredir.debian.org jessie InRelease Hit http://httpredir.debian.org jessie-updates InRelease Hit http://httpredir.debian.org jessie Release.gpg Get:2 https://deb.nodesource.com jessie/main Sources [20 B] Hit http://httpredir.debian.org jessie Release Get:3 https://deb.nodesource.com jessie/main amd64 Packages [765 B] Get:4 http://security.debian.org jessie/updates/main amd64 Packages [802 kB] Get:5 http://httpredir.debian.org jessie-updates/main amd64 Packages [23.0 kB] Get:6 http://httpredir.debian.org jessie/main amd64 Packages [9098 kB] Fetched 9928 kB in 7s (1297 kB/s) Reading package lists... Done ## Run `sudo apt-get install -y nodejs` to install Node.js 9.x and npm ## You may also need development tools to build native addons: sudo apt-get install gcc g++ make ## To install the Yarn package manager, run: curl -sL 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 sudo apt-get update && sudo apt-get install yarn root@a46e0bbaa8e7:/go/src/github.com/myrepo/myapp_gae# apt update -y Hit https://deb.nodesource.com jessie InRelease Hit http://security.debian.org jessie/updates InRelease Ign http://httpredir.debian.org jessie InRelease Hit http://httpredir.debian.org jessie-updates InRelease Hit http://httpredir.debian.org jessie Release.gpg Hit http://httpredir.debian.org jessie Release Get:1 https://deb.nodesource.com jessie/main Sources [20 B] Get:2 https://deb.nodesource.com jessie/main amd64 Packages [765 B] Get:3 http://security.debian.org jessie/updates/main amd64 Packages [802 kB] Get:4 http://httpredir.debian.org jessie-updates/main amd64 Packages [23.0 kB] Get:5 http://httpredir.debian.org jessie/main amd64 Packages [9098 kB] Fetched 9924 kB in 6s (1548 kB/s) Reading package lists... Done Building dependency tree Reading state information... Done 36 packages can be upgraded. Run 'apt list --upgradable' to see them. root@a46e0bbaa8e7:/go/src/github.com/myrepo/myapp_gae# apt install nodejs -y Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libc-ares2 libv8-3.14.5 Use 'apt-get autoremove' to remove them. The following packages will be upgraded: nodejs 1 upgraded, 0 newly installed, 0 to remove and 35 not upgraded. Need to get 12.8 MB of archives. After this operation, 59.5 MB of additional disk space will be used. Get:1 https://deb.nodesource.com/node_9.x/ jessie/main nodejs amd64 9.11.2-1nodesource1 [12.8 MB] Fetched 12.8 MB in 0s (14.7 MB/s) debconf: delaying package configuration, since apt-utils is not installed (Reading database ... 16215 files and directories currently installed.) Preparing to unpack .../nodejs_9.11.2-1nodesource1_amd64.deb ... Unpacking nodejs (9.11.2-1nodesource1) over (0.10.29~dfsg-2) ... Setting up nodejs (9.11.2-1nodesource1) ... root@a46e0bbaa8e7:/go/src/github.com/myrepo/myapp_gae# npm install -g n /usr/bin/n -> /usr/lib/node_modules/n/bin/n + n@2.1.12 added 1 package in 0.351s root@a46e0bbaa8e7:/go/src/github.com/myrepo/myapp_gae# n 9.11.1 install : node-v9.11.1 mkdir : /usr/local/n/versions/node/9.11.1 fetch : https://nodejs.org/dist/v9.11.1/node-v9.11.1-linux-x64.tar.gz ######################################################################## 100.0% installed : v9.11.1 root@a46e0bbaa8e7:/go/src/github.com/myrepo/myapp_gae# node -v v9.11.1 root@a46e0bbaa8e7:/go/src/github.com/myrepo/myapp_gae# cd src/myapp/ root@a46e0bbaa8e7:/go/src/github.com/myrepo/myapp_gae/src/myapp# npm install > node-sass@4.11.0 install /go/src/github.com/myrepo/myapp_gae/src/myapp/node_modules/node-sass > node scripts/install.js Downloading binary from https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-59_binding.node Download complete .] - : Binary saved to /go/src/github.com/myrepo/myapp_gae/src/myapp/node_modules/node-sass/vendor/linux-x64-59/binding.node Caching binary to /root/.npm/node-sass/4.11.0/linux-x64-59_binding.node > uglifyjs-webpack-plugin@0.4.6 postinstall /go/src/github.com/myrepo/myapp_gae/src/myapp/node_modules/uglifyjs-webpack-plugin > node lib/post_install.js > node-sass@4.11.0 postinstall /go/src/github.com/myrepo/myapp_gae/src/myapp/node_modules/node-sass > node scripts/build.js Binary found at /go/src/github.com/myrepo/myapp_gae/src/myapp/node_modules/node-sass/vendor/linux-x64-59/binding.node Testing binary Binary is fine npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/react-scripts/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) added 1699 packages in 22.678s root@a46e0bbaa8e7:/go/src/github.com/myrepo/myapp_gae/src/myapp# npm run build --loglevel silly npm info it worked if it ends with ok npm verb cli [ '/usr/local/bin/node', npm verb cli '/usr/bin/npm', npm verb cli 'run', npm verb cli 'build', npm verb cli '--loglevel', npm verb cli 'silly' ] npm info using npm@5.6.0 npm info using node@v9.11.1 npm verb run-script [ 'prebuild', 'build', 'postbuild' ] npm info lifecycle myapp@0.1.0~prebuild: myapp@0.1.0 npm info lifecycle myapp@0.1.0~build: myapp@0.1.0 > myapp@0.1.0 build /go/src/github.com/myrepo/myapp_gae/src/myapp > npm run build-css && npm run build-js npm info it worked if it ends with ok npm verb cli [ '/usr/local/bin/node', npm verb cli '/usr/local/bin/npm', npm verb cli 'run', npm verb cli 'build-css' ] npm info using npm@5.6.0 npm info using node@v9.11.1 npm verb run-script [ 'prebuild-css', 'build-css', 'postbuild-css' ] npm info lifecycle myapp@0.1.0~prebuild-css: myapp@0.1.0 npm info lifecycle myapp@0.1.0~build-css: myapp@0.1.0 > myapp@0.1.0 build-css /go/src/github.com/myrepo/myapp_gae/src/myapp > node-sass-chokidar ./src/scss/App.scss ./src/App.css Rendering Complete, saving .css file... Wrote CSS to /go/src/github.com/myrepo/myapp_gae/src/myapp/src/App.css npm verb lifecycle myapp@0.1.0~build-css: unsafe-perm in lifecycle true npm verb lifecycle myapp@0.1.0~build-css: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/go/src/github.com/myrepo/myapp_gae/src/myapp/node_modules/.bin:/usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/go/src/github.com/myrepo/myapp_gae/src/myapp/node_modules/.bin:/go/bin:/usr/local/go/bin:/usr/lib/google-cloud-sdk/bin:/usr/lib/google-cloud-sdk/platform/google_appengine:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin npm verb lifecycle myapp@0.1.0~build-css: CWD: /go/src/github.com/myrepo/myapp_gae/src/myapp npm sill lifecycle myapp@0.1.0~build-css: Args: [ '-c', 'node-sass-chokidar ./src/scss/App.scss ./src/App.css' ] npm sill lifecycle myapp@0.1.0~build-css: Returned: code: 0 signal: null npm info lifecycle myapp@0.1.0~postbuild-css: myapp@0.1.0 npm verb exit [ 0, true ] npm info ok npm info it worked if it ends with ok npm verb cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'build-js' ] npm info using npm@5.6.0 npm info using node@v9.11.1 npm verb run-script [ 'prebuild-js', 'build-js', 'postbuild-js' ] npm info lifecycle myapp@0.1.0~prebuild-js: myapp@0.1.0 npm info lifecycle myapp@0.1.0~build-js: myapp@0.1.0 > myapp@0.1.0 build-js /go/src/github.com/myrepo/myapp_gae/src/myapp > react-scripts build Creating an optimized production build... Compiled with warnings. ./src/pages/GoodByePage/GoodByePage.js Line 10: 'Cookies' is defined but never used no-unused-vars ./src/components/AvatarUploadForm.js Line 119: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text ./src/components/ItemImage.js Line 12: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text ./src/components/FeedImage.js Line 14: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text ./src/components/Avatar.js Line 16: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text ./src/pages/TimelinePage/TimelinePage.js Line 25: Do not mutate state directly. Use setState() react/no-direct-mutation-state ./src/components/ScrollContainer.js Line 39: Do not mutate state directly. Use setState() react/no-direct-mutation-state ./src/components/Navbar.js Line 39: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text ./src/pages/LandingPage/LandingPage.js Line 54: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text ./src/App.css (Emitted value instead of an instance of Error) autoprefixer: /go/src/github.com/myrepo/myapp_gae/src/myapp/src/App.css:3076:5: Second Autoprefixer control comment was ignored. Autoprefixer applies control comment to whole block, not to next rules. Search for the keywords to learn more about each warning. To ignore, add // eslint-disable-next-line to the line before. File sizes after gzip: 94.77 KB build/static/js/main.33083275.js 11.32 KB build/static/css/main.83f3ba1e.css The project was built assuming it is hosted at the server root. You can control this with the homepage field in your package.json. For example, add this to build it for GitHub Pages: "homepage" : "http://myname.github.io/myapp_gae", The build folder is ready to be deployed. You may serve it with a static server: npm install -g serve serve -s build Find out more about deployment here: http://bit.ly/2vY88Kr npm verb lifecycle myapp@0.1.0~build-js: unsafe-perm in lifecycle true npm verb lifecycle myapp@0.1.0~build-js: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/go/src/github.com/myrepo/myapp_gae/src/myapp/node_modules/.bin:/usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/go/src/github.com/myrepo/myapp_gae/src/myapp/node_modules/.bin:/go/bin:/usr/local/go/bin:/usr/lib/google-cloud-sdk/bin:/usr/lib/google-cloud-sdk/platform/google_appengine:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin npm verb lifecycle myapp@0.1.0~build-js: CWD: /go/src/github.com/myrepo/myapp_gae/src/myapp npm sill lifecycle myapp@0.1.0~build-js: Args: [ '-c', 'react-scripts build' ] npm sill lifecycle myapp@0.1.0~build-js: Returned: code: 0 signal: null npm info lifecycle myapp@0.1.0~postbuild-js: myapp@0.1.0 npm verb exit [ 0, true ] npm info ok npm verb lifecycle myapp@0.1.0~build: unsafe-perm in lifecycle true npm verb lifecycle myapp@0.1.0~build: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/go/src/github.com/myrepo/myapp_gae/src/myapp/node_modules/.bin:/go/bin:/usr/local/go/bin:/usr/lib/google-cloud-sdk/bin:/usr/lib/google-cloud-sdk/platform/google_appengine:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin npm verb lifecycle myapp@0.1.0~build: CWD: /go/src/github.com/myrepo/myapp_gae/src/myapp npm sill lifecycle myapp@0.1.0~build: Args: [ '-c', 'npm run build-css && npm run build-js' ] npm sill lifecycle myapp@0.1.0~build: Returned: code: 0 signal: null npm info lifecycle myapp@0.1.0~postbuild: myapp@0.1.0 npm verb exit [ 0, true ] npm info ok root@a46e0bbaa8e7:/go/src/github.com/myrepo/myapp_gae/src/myapp# ```
eric-hu commented 5 years ago

Thank you for the additional information. My hypothesis is that circleci local execute is running with the environment variable setting CI=true. This message is the key:

(On circleci local execute)

Treating warnings as errors because process.env.CI = true. Most CI servers set it automatically.

(On your local by-hand reproduction)

Creating an optimized production build... Compiled with warnings.

To check this hypothesis, can you re-run your operation by hand including export CI=true before npm run build --loglevel silly?

ryo-yamaoka commented 5 years ago

I've reappeared error in docker run environment by export CI=true, then it solved by set export CI=false in circleci local execute environment. I understand error cause, maybe I can resolve remaining issue. Thank you very much!