Web3.js: Installation with npm fails (beta4)

Created on 20 Jul 2017  ·  8Comments  ·  Source: ChainSafe/web3.js

Web3 version: 1.0.0-beta.4

Installation with npm fails with this message:

> [email protected] postinstall /Users/ivan/Documents/node_modules/web3
> lerna bootstrap

sh: lerna: command not found
npm WARN enoent ENOENT: no such file or directory, open '/Users/ivan/Documents/package.json'
npm WARN Documents No description
npm WARN Documents No repository field.
npm WARN Documents No README data
npm WARN Documents No license field.

npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] postinstall: `lerna bootstrap`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Logs:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/8.1.3/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   'web3' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 1a3617f1b44eae7b
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 200 https://registry.npmjs.org/web3 520ms
8 silly pacote tag manifest for web3@latest fetched in 613ms
9 silly install loadIdealTree
10 silly install cloneCurrentTreeToIdealTree
11 silly install loadShrinkwrap
12 silly install loadAllDepsIntoIdealTree
13 silly resolveWithNewModule [email protected] checking installable status
14 silly currentTree Documents
15 silly idealTree Documents
15 silly idealTree └── [email protected]
16 silly install generateActionsToTake
17 silly diffTrees action count 1
18 silly diffTrees add [email protected]
19 silly decomposeActions action count 8
20 silly decomposeActions fetch [email protected]
21 silly decomposeActions extract [email protected]
22 silly decomposeActions preinstall [email protected]
23 silly decomposeActions build [email protected]
24 silly decomposeActions install [email protected]
25 silly decomposeActions postinstall [email protected]
26 silly decomposeActions finalize [email protected]
27 silly decomposeActions refresh-package-json [email protected]
28 silly install executeActions
29 silly doSerial global-install 8
30 verbose correctMkdir /Users/ivan/.npm/_locks correctMkdir not in flight; initializing
31 verbose lock using /Users/ivan/.npm/_locks/staging-1e5878cc238e33bc.lock for /Users/ivan/Documents/node_modules/.staging
32 silly doParallel extract 8
33 silly extract [email protected]
34 silly doReverseSerial remove 8
35 silly doSerial move 8
36 silly doSerial finalize 8
37 silly finalize /Users/ivan/Documents/node_modules/web3
38 silly doParallel refresh-package-json 8
39 silly refresh-package-json /Users/ivan/Documents/node_modules/web3
40 silly doParallel preinstall 8
41 silly preinstall [email protected]
42 info lifecycle [email protected]~preinstall: [email protected]
43 silly doSerial build 8
44 silly build [email protected]
45 info linkStuff [email protected]
46 silly linkStuff [email protected] has /Users/ivan/Documents/node_modules as its parent node_modules
47 verbose linkBins [email protected]
48 verbose linkMans [email protected]
49 silly doSerial global-link 8
50 silly doParallel update-linked 8
51 silly doSerial install 8
52 silly install [email protected]
53 info lifecycle [email protected]~install: [email protected]
54 silly doSerial postinstall 8
55 silly postinstall [email protected]
56 info lifecycle [email protected]~postinstall: [email protected]
57 verbose lifecycle [email protected]~postinstall: unsafe-perm in lifecycle true
58 verbose lifecycle [email protected]~postinstall: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/ivan/Documents/node_modules/web3/node_modules/.bin:/Users/ivan/Documents/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
59 verbose lifecycle [email protected]~postinstall: CWD: /Users/ivan/Documents/node_modules/web3
60 silly lifecycle [email protected]~postinstall: Args: [ '-c', 'lerna bootstrap' ]
61 info lifecycle [email protected]~postinstall: Failed to exec postinstall script
62 verbose unlock done using /Users/ivan/.npm/_locks/staging-1e5878cc238e33bc.lock for /Users/ivan/Documents/node_modules/.staging
63 warn enoent ENOENT: no such file or directory, open '/Users/ivan/Documents/package.json'
64 verbose enoent This is related to npm not being able to find a file.
65 warn Documents No description
66 warn Documents No repository field.
67 warn Documents No README data
68 warn Documents No license field.
69 verbose stack Error: [email protected] postinstall: `lerna bootstrap`
69 verbose stack spawn ENOENT
69 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:33:16)
69 verbose stack     at emitTwo (events.js:125:13)
69 verbose stack     at ChildProcess.emit (events.js:213:7)
69 verbose stack     at maybeClose (internal/child_process.js:897:16)
69 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
70 verbose pkgid [email protected]
71 verbose cwd /Users/ivan/Documents
72 verbose Darwin 16.6.0
73 verbose argv "/usr/local/Cellar/node/8.1.3/bin/node" "/usr/local/bin/npm" "install" "web3"
74 verbose node v8.1.3
75 verbose npm  v5.2.0
76 error file sh
77 error code ELIFECYCLE
78 error errno ENOENT
79 error syscall spawn
80 error [email protected] postinstall: `lerna bootstrap`
80 error spawn ENOENT
81 error Failed at the [email protected] postinstall script.
81 error This is probably not a problem with npm. There is likely additional logging output above.
82 verbose exit [ 1, true ]

Most helpful comment

I'm having the same issue

All 8 comments

I'm having the same issue

+1. Doing yarn global add lerna before adding web3 fixes it.

Edit: now I'm getting:

./~/web3/packages/web3-bzz/~/swarm-js/lib/swarm.js
Module not found: Can't resolve 'child_process' in '/home/vdrg/Work/buttons-example/node_modules/web3/packages/web3-bzz/node_modules/swarm-js/lib'

I'm also having the same issue

Run npm i -g lerna and try again!

I have the same issue

Run npm i -g lerna and try again!

Yep, this helps.

I will point to the local lerna in the next beta release.

Should be fixed in beta.6

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xpepermint picture xpepermint  ·  3Comments

joeriexelmans picture joeriexelmans  ·  3Comments

oktapodia picture oktapodia  ·  3Comments

gabmontes picture gabmontes  ·  3Comments

mishell-trickster picture mishell-trickster  ·  3Comments