eosjs icon indicating copy to clipboard operation
eosjs copied to clipboard

Can't run build-web

Open philipeachille opened this issue 6 years ago • 6 comments

Hi! I can't run npm run build-web.

I get a lot of errors like this:

ERROR in /.../eosjs/node_modules/jest-diff/build/index. d.ts [tsl] ERROR in /.../eosjs/node_modules/jest-diff/build/ index.d.ts(10,13) TS1005: '=' expected.

I get this in npm logs:

0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'build-web' ] 2 info using [email protected] 3 info using [email protected] 4 verbose run-script [ 'prebuild-web', 'build-web', 'postbuild-web' ] 5 info lifecycle [email protected]~prebuild-web: [email protected] 6 info lifecycle [email protected]~build-web: [email protected] 7 verbose lifecycle [email protected]~build-web: unsafe-perm in lifecycle true 8 verbose lifecycle [email protected]~build-web: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/pav/Desktop/PROJECTS/V/Code/eosjs/node_modules/.bin:/usr/local/opt/[email protected]/sbin:/usr/local/opt/[email protected]/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/[email protected]/sbin:/usr/local/opt/[email protected]/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin 9 verbose lifecycle [email protected]~build-web: CWD: /Users/pav/Desktop/PROJECTS/V/Code/eosjs 10 silly lifecycle [email protected]~build-web: Args: [ 10 silly lifecycle '-c', 10 silly lifecycle 'webpack --config webpack.prod.js && webpack --config webpack.debug.js' 10 silly lifecycle ] 11 silly lifecycle [email protected]~build-web: Returned: code: 2 signal: null 12 info lifecycle [email protected]~build-web: Failed to exec build-web script 13 verbose stack Error: [email protected] build-web: webpack --config webpack.prod.js && webpack --config webpack.debug.js 13 verbose stack Exit status 2 13 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16) 13 verbose stack at EventEmitter.emit (events.js:321:20) 13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:321:20) 13 verbose stack at maybeClose (internal/child_process.js:1026:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) 14 verbose pkgid [email protected] 15 verbose cwd /Users/pav/Desktop/PROJECTS/V/Code/eosjs 16 verbose Darwin 17.4.0 17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build-web" 18 verbose node v13.7.0 19 verbose npm v6.13.6 20 error code ELIFECYCLE 21 error errno 2 22 error [email protected] build-web: webpack --config webpack.prod.js && webpack --config webpack.debug.js 22 error Exit status 2 23 error Failed at the [email protected] build-web script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 2, true ]

philipeachille avatar May 18 '20 13:05 philipeachille

Can you try cloning this repo, then run build-web instead of trying to run that script from your app? https://github.com/EOSIO/eosjs#browser-distribution

jlamarr22 avatar May 18 '20 14:05 jlamarr22

Hi, thanks for the swift reply. This is what I did now:

git clone https://github.com/EOSIO/eosjs.git cd eosjs npm i npm build-web

which produces:

[email protected] build-web /Users/pav/Desktop/PROJECTS/eosjs webpack --config webpack.prod.js && webpack --config webpack.debug.js

Hash: 7dc8c021b861537f4210 Version: webpack 4.29.5 Time: 18362ms Built at: 05/18/2020 6:08:52 PM 4 assets Entrypoint eosjs_api = eosjs-api.js Entrypoint eosjs_jsonrpc = eosjs-jsonrpc.js Entrypoint eosjs_jssig = eosjs-jssig.js Entrypoint eosjs_numeric = eosjs-numeric.js [3] (webpack)/buildin/global.js 472 bytes {1} {2} [built] [7] ./src/eosjs-numeric.ts 13.9 KiB {0} {1} {2} {3} [built] [8] ./src/ripemd.js 13.3 KiB {0} {1} {2} {3} [built] [34] ./src/eosjs-rpcerror.ts 1.52 KiB {1} [built] [69] ./src/eosjs-api.ts 21.3 KiB {0} [built] [70] ./src/eosjs-serialize.ts 40.2 KiB {0} [built] [71] ./src/abi.abi.json 4.79 KiB {0} [built] [72] ./src/transaction.abi.json 2.94 KiB {0} [built] [73] ./src/rpc-web.ts 268 bytes {1} [built] [74] ./src/eosjs-jsonrpc.ts 18.6 KiB {1} [built] [75] ./src/eosjs-jssig.ts 5.26 KiB {2} [built] [87] util (ignored) 15 bytes {2} [built] [89] util (ignored) 15 bytes {2} [built] [99] util (ignored) 15 bytes {2} [built] [101] util (ignored) 15 bytes {2} [built] + 121 hidden modules

ERROR in /Users/pav/Desktop/PROJECTS/eosjs/node_modules/jest-diff/build/index.d.ts [tsl] ERROR in /Users/pav/Desktop/PROJECTS/eosjs/node_modules/jest-diff/build/index.d.ts(10,13) TS1005: '=' expected.

ERROR in /Users/pav/Desktop/PROJECTS/eosjs/node_modules/jest-diff/build/index.d.ts [tsl] ERROR in /Users/pav/Desktop/PROJECTS/eosjs/node_modules/jest-diff/build/index.d.ts(10,34) TS1005: ';' expected.

ERROR in /Users/pav/Desktop/PROJECTS/eosjs/node_modules/jest-diff/build/index.d.ts [tsl] ERROR in /Users/pav/Desktop/PROJECTS/eosjs/node_modules/jest-diff/build/index.d.ts(11,1) TS1128: Declaration or statement expected.

ERROR in /Users/pav/Desktop/PROJECTS/eosjs/node_modules/jest-diff/build/index.d.ts [tsl] ERROR in /Users/pav/Desktop/PROJECTS/eosjs/node_modules/jest-diff/build/index.d.ts(11,13) TS1005: ';' expected.

ERROR in /Users/pav/Desktop/PROJECTS/eosjs/node_modules/jest-diff/build/index.d.ts [tsl] ERROR in /Users/pav/Desktop/PROJECTS/eosjs/node_modules/jest-diff/build/index.d.ts(11,52) TS1005: ';' expected.

ERROR in /Users/pav/Desktop/PROJECTS/eosjs/node_modules/jest-diff/build/diffLines.d.ts [tsl] ERROR in /Users/pav/Desktop/PROJECTS/eosjs/node_modules/jest-diff/build/diffLines.d.ts(8,13) TS1005: '=' expected.

ERROR in /Users/pav/Desktop/PROJECTS/eosjs/node_modules/jest-diff/build/diffLines.d.ts [tsl] ERROR in /Users/pav/Desktop/PROJECTS/eosjs/node_modules/jest-diff/build/diffLines.d.ts(8,34) TS1005: ';' expected.

ERROR in /Users/pav/Desktop/PROJECTS/eosjs/node_modules/jest-diff/build/printDiffs.d.ts [tsl] ERROR in /Users/pav/Desktop/PROJECTS/eosjs/node_modules/jest-diff/build/printDiffs.d.ts(8,13) TS1005: '=' expected.

ERROR in /Users/pav/Desktop/PROJECTS/eosjs/node_modules/jest-diff/build/printDiffs.d.ts [tsl] ERROR in /Users/pav/Desktop/PROJECTS/eosjs/node_modules/jest-diff/build/printDiffs.d.ts(8,57) TS1005: ';' expected. npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! [email protected] build-web: webpack --config webpack.prod.js && webpack --config webpack.debug.js npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the [email protected] build-web script.

philipeachille avatar May 18 '20 16:05 philipeachille

Looks like this issue is caused by this: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/36299

You can fix this by upgrading the Typescript version to 3.8.3. If you want to run this script now, please update the Typescript version manually and then run the script. We'll release a fix for this soon.

jlamarr22 avatar May 18 '20 16:05 jlamarr22

Yes, upgrading Typescript to version 3.8.3 worked

thank you

philipeachille avatar May 19 '20 05:05 philipeachille

Fixed in https://github.com/EOSIO/eosjs/pull/707

jlamarr22 avatar May 19 '20 17:05 jlamarr22

downgrading jest to 24.0.0 solved my issue.

nandakola avatar Jun 15 '20 18:06 nandakola