Same here. I installed latest web3 on linuxmint and got the same error.
When I checked node's bin folder there is no short cut to execution file like other modules nor web3 folder contains bin folder
Did you install web3 locally or globally ? Because whenever I have had this problem it is because the web3 library is not in the directory where I am running node
I installed it globally after i got error installing it locally
npm WARN saveError ENOENT: no such file or directory, open '/mnt/DATA/DevProjects/Ethereum/Tutorials/hello_world_voting/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/mnt/DATA/DevProjects/Ethereum/Tutorials/hello_world_voting/package.json'
Run npm init and create a package.json file. Then in there add the web3 library. You should be able to install it locally then
Yeah, I just ahd this issue and solved it the way @nisdas suggested. For some reason even running npm install -g web3 won't allow you to run it from anywhere.
@nisdas can you elaborate how to use the npm init to install web3? I'm lost. Thanks
@saad19296 just run npm init which should create a package.json file. Then run npm install web3 in that directory. The web3 module is then downloaded into that directory
Just create a new folder, npm init and npm install web3 within that. I think the require function must be looking for a node_modules folder which won't exist if you just run your app from any directory.
Most helpful comment
Just create a new folder,
npm initandnpm install web3within that. I think the require function must be looking for anode_modulesfolder which won't exist if you just run your app from any directory.