EOSIO / eosjs

General purpose library for the EOSIO blockchain.
http://eosio.github.io/eosjs
MIT License
1.43k stars 463 forks source link

Can't run build-web #721

Closed philipeachille closed 4 years ago

philipeachille commented 4 years ago

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 npm@6.13.6 3 info using node@v13.7.0 4 verbose run-script [ 'prebuild-web', 'build-web', 'postbuild-web' ] 5 info lifecycle eosjs@20.0.3~prebuild-web: eosjs@20.0.3 6 info lifecycle eosjs@20.0.3~build-web: eosjs@20.0.3 7 verbose lifecycle eosjs@20.0.3~build-web: unsafe-perm in lifecycle true 8 verbose lifecycle eosjs@20.0.3~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/php@7.2/sbin:/usr/local/opt/php@7.2/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/php@7.2/sbin:/usr/local/opt/php@7.2/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin 9 verbose lifecycle eosjs@20.0.3~build-web: CWD: /Users/pav/Desktop/PROJECTS/V/Code/eosjs 10 silly lifecycle eosjs@20.0.3~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 eosjs@20.0.3~build-web: Returned: code: 2 signal: null 12 info lifecycle eosjs@20.0.3~build-web: Failed to exec build-web script 13 verbose stack Error: eosjs@20.0.3 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 eosjs@20.0.3 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 eosjs@20.0.3 build-web: webpack --config webpack.prod.js && webpack --config webpack.debug.js 22 error Exit status 2 23 error Failed at the eosjs@20.0.3 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 ]

jlamarr22 commented 4 years ago

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

philipeachille commented 4 years ago

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:

eosjs@20.0.3 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]

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! eosjs@20.0.3 build-web: webpack --config webpack.prod.js && webpack --config webpack.debug.js npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the eosjs@20.0.3 build-web script.

jlamarr22 commented 4 years ago

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.

philipeachille commented 4 years ago

Yes, upgrading Typescript to version 3.8.3 worked

thank you

jlamarr22 commented 4 years ago

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

nandakola commented 4 years ago

downgrading jest to 24.0.0 solved my issue.