I Can't install Web3 - npm

I have to install Web3 which is a ethereum library but I can't install in linux mint 18.
$ sudo npm install web3 --save
[sudo] password for taylor:
npm WARN deprecated fs-promise#2.0.3: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated tar.gz#1.0.7: ⚠️ WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar
npm WARN deprecated minimatch#0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm ERR! code ENOGIT
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/taylor/.npm/_logs/2018-02-01T12_55_24_014Z-debug.log
What can I do?

The error clearly states that you are missing git.
Try installing git first and give it a go ?

Related

cannot install #material-ui/core using npm

I tried to install #material-ui/core librabry but then npm throws the error below
I used the
npm install #material-ui
command
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: school-demo#0.1.0
npm ERR! Found: react#17.0.1
npm ERR! node_modules/react
npm ERR! react#"^17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8.0" from #material-ui/core#4.11.0
npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/freduah/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/freduah/.npm/_logs/2020-11-02T14_50_03_045Z-debug.log
freduah#freduah:~/school-demo$ ```
MaterialUI 4 doesn't support React 17 yet. Please check the issue created on github https://github.com/mui-org/material-ui/issues/23306.
You can try to install it by force by adding '-f':
npm install -f #material-ui/core
I had come across the same problem. These worked for me:
For core: npm -f install #material-ui/core
For icons: npm -f install #material-ui/icons
you can downgrade your react, it worked for me by this command:(I downgrade from v17)
npm install --save react#16.13.0 react-dom#16.13.0
Material UI is using emotion as a styling engine by default. If you want to use styled-components instead, run:
try to use this
npm install #mui/material #mui/styled-engine-sc styled-components
i highly recommend to read the document in thar website and not from npm
npm install #mui/material #emotion/react #emotion/styled
worked for me. Which I found on https://mui.com/
check your react versian, MaterialUI 4 doesn't support React 17. you can change youre version by
npm install --save react#16.13.0 react-dom#16.13.0
make sure Assuming you're using npm/yarn or another node package manager, dependency versions are listed in package.json.
Search for the react and react-dom packages under dependencies (or devDependencies) and replace their versions with 16.13.0. Then run npm install or yarn or whatever package manager you're using. This should be enough to downgrade to React 16.
Try
yarn add #material-ui/core & yarn add #material-ui/core
React 17 dont support material UI install previous versions or use yarn It will take some time but work perfectly fine
This worked for me
npm install -force #material-ui/core
Problem: npm install #material-ui/core
Solution:
npm install #mui/material #emotion/react #emotion/styled
OR
yarn add #mui/material #emotion/react #emotion/styled
npm install -f #material-ui/core
or
npm install #mui/material #emotion/react #emotion/styled --legacy-peer-deps
or You can downgrade react
npm install --save react#16.13.0 react-dom#16.13.0

Cannot install firebase CLI with npm

When I try to install firebase-tools with:
npm install -g firebase-tools
I get the following error:
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated mkdirp#0.5.4: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
/usr/local/bin/firebase -> /usr/local/lib/node_modules/firebase-tools/lib/bin/firebase.js
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/2609/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> protobufjs#6.8.9 postinstall /usr/local/lib/node_modules/firebase-tools/node_modules/protobufjs
> node scripts/postinstall
2020/03/31 16:23:53.220338 cmd_run.go:884: WARNING: cannot create user data directory: cannot create "/nonexistent/snap/node/2609": mkdir /nonexistent: permission denied
cannot create user data directory: /nonexistent/snap/node/2609: Permission denied
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.1.2 (node_modules/firebase-tools/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! protobufjs#6.8.9 postinstall: `node scripts/postinstall`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the protobufjs#6.8.9 postinstall 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! /home/david/.npm/_logs/2020-03-31T21_23_53_670Z-debug.log
I have googled this error but haven't found anything related. What can I do to install firebase-tools?
Reason: You used used snap to install node and snap does not allows apps to write to /usr/local and this is where all the global packages are installed.
What you can do to fix this?
snap remove node - uninstall the snap version of node
sudo apt-get install nodejs - install nodejs
npm install -g firebase-tools - this should work now
i had the same problem but i fixed it by not installing it globally
try this
npm install firebase-tools
or
sudo npm install -g firebase-tools

How can I install web3 globally in Ubuntu 16.04?

I am trying to install web3 via npm.
sudo npm install -g web3
But I faced below error.
tom#ubuntu:/$ sudo npm install -g web3
npm WARN deprecated fs-promise#2.0.3: Use mz or fs-extra^3.0 with Promise
Support
npm WARN deprecated tar.gz#1.0.7: ⚠️ WARNING ⚠️ tar.gz module has been
deprecated and your application is vulnerable. Please use tar module instead:
https://npmjs.com/tar
npm ERR! code 1
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b browserifyCompatible
git://github.com/frozeman/WebSocket-Node.git
/home/tom/.npm/_cacache/tmp/git-
clone-d38db07b
npm ERR! /home/tom/.npm/_cacache/tmp/git-clone-d38db07b/.git: Permission denied
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /home/tom/.npm/_logs/2018-02-07T14_42_37_459Z-debug.log
How can I install web3?
Looks like your local .npm permissions are messed up. Just remove NPM cache by running:
sudo rm -rf /home/tom/.npm
and then try again.

Give me error while install polymer

E:>npm install -g polymer-cli
npm WARN deprecated babel-preset-es2015#6.24.1: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated bower#1.8.2: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
npm ERR! Unexpected end of JSON input while parsing near '..."ordered-read-streams'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cache_logs\2017-12-23T05_41_50_907Z-debug.log

Error Installing web3js for Ethereum / Unable to connect to github.com

I'm using npm to install web3js:
npm install web3
It eventually fails. Here is the output I get...
npm WARN deprecated tar.gz#1.0.7: â ï¸ WARNING â ï¸ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar
npm WARN deprecated fs-promise#2.0.3: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated minimatch#0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t git://github.com/frozeman/WebSocket-Node.git
npm ERR!
npm ERR! fatal: unable to connect to github.com:
npm ERR! github.com[0: 192.30.255.113]: errno=Connection timed out
npm ERR! github.com[1: 192.30.255.112]: errno=Connection timed out
Here is some version info:
uname -a
Linux bde2744830c3 4.1.12-103.7.1.el7uek.x86_64
npm --version
5.5.1
I've scoured SO and other sites that have somewhat similar postings, but nothing that offers help. I've tried
npm cache verify
To no avail.
It's probably due to the repo url using the git protocol (git://) instead of http. Please make sure you have inbound port 9418 open for it to work.
Hope that helps.