Skip to content

Instantly share code, notes, and snippets.

@dobbs
Last active May 14, 2018 22:05
Show Gist options
  • Save dobbs/da549239d2504df986364678440e0e42 to your computer and use it in GitHub Desktop.
Save dobbs/da549239d2504df986364678440e0e42 to your computer and use it in GitHub Desktop.
npm info lifecycle origin-demo-dapp@0.3.0~build: Failed to exec build script

build failing

I think this indicates there are hidden dependencies.

The dockerfile is really minimial. Basically:

git clone ... # demo-dapp's master branch
cd demo-dapp
npm install
npm run build

# copy the ./build folder to a web container

fails in the npm run build.

docker build .
Step 5/7 : RUN cd demo-dapp && npm run build
---> Running in 77216d951ff2
npm info it worked if it ends with ok
npm info using npm@5.3.0
npm info using node@v8.5.0
npm info lifecycle origin-demo-dapp@0.3.0~prebuild: origin-demo-dapp@0.3.0
npm info lifecycle origin-demo-dapp@0.3.0~build: origin-demo-dapp@0.3.0
> origin-demo-dapp@0.3.0 build /usr/local/src/demo-dapp
> NODE_ENV=production webpack --progress --display errors-only
Failed to load ./.env.
clean-webpack-plugin: /usr/local/src/demo-dapp/build has been removed.
92% chunk asset optimization UglifyJSPlugin
ERROR in ./node_modules/web3-providers-ws/src/index.js
Module not found: Error: Can't resolve 'websocket' in '/usr/local/src/demo-dapp/node_modules/web3-providers-ws/src'
@ ./node_modules/web3-providers-ws/src/index.js 38:9-29
@ ./node_modules/web3-core-requestmanager/src/index.js
@ ./node_modules/web3-core/src/index.js
@ ./node_modules/web3/src/index.js
@ ./node_modules/origin/dist/index.js
@ ./src/services/origin.js
@ ./src/components/listing-create.js
@ ./src/components/app.js
@ ./src/index.js
npm info lifecycle origin-demo-dapp@0.3.0~build: Failed to exec build script
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! origin-demo-dapp@0.3.0 build: `NODE_ENV=production webpack --progress --display errors-only`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the origin-demo-dapp@0.3.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! /root/.npm/_logs/2018-05-14T21_46_31_676Z-debug.log
The command '/bin/sh -c cd demo-dapp && npm run build' returned a non-zero code: 2
FROM node:8.5 as src
WORKDIR /usr/local/src
RUN git clone "https://github.com/OriginProtocol/demo-dapp.git" \
--branch master
RUN cd demo-dapp && npm install
RUN cd demo-dapp && npm run build
FROM abiosoft/caddy:0.11.0
COPY --from=src /usr/local/src/demo-dapp/build/ /srv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment