npm install --save web3#1.0.0-beta.36 fail on a mac - npm

In order to manage solidity contracts, I need to install web3 on my mac. I use npm install for web3 and it generates errors. Can anybody help?
this is the error message I get :
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! xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
npm ERR!
npm ERR! exited with error code: 1

Related

Error when updating my dependencies in React

I just added some code to my dependencies list in my package.json file. I ran NPM update --save and I am getting this error
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git#github.com/process/browser.git
npm ERR! git#github.com: Permission denied (publickey).npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR! A complete log of this run can be found in:

npm install giving error: pathspec '4.0' did not match any file(s) known to git

I had cloned a truffle project from GitHub, while doing npm install am getting following error:
npm ERR! command /opt/homebrew/Cellar/node/17.3.0/bin/node /opt/homebrew/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/rohit12242/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code 1
npm ERR! npm ERR! The git reference could not be found
npm ERR! npm ERR! command git --no-replace-objects checkout 4.0
npm ERR! npm ERR! error: pathspec '4.0' did not match any file(s) known to git
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
I installed node version 11 and fixed this error

npm install code 1 error git dep preparation failed

Has anyone hit the error below when trying to install NPM?
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /home/user1/.nvm/versions/node/v15.12.0/bin/node /home/user1/.nvm/versions/node/v15.12.0/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/home/user1/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code 1
npm ERR! npm ERR! The git reference could not be found
npm ERR! npm ERR! command git --no-replace-objects checkout 4.0
npm ERR! npm ERR! error: pathspec '4.0' did not match any file(s) known to git
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR! /home/user1/.npm/_logs/2021-07-27T07_22_59_809Z-debug.log
npm ERR! A complete log of this run can be found in:
npm ERR! /home/user1/.npm/_logs/2021-07-27T07_24_31_341Z-debug.log
In my case I got that error while using node v16.13.0. After I switched to v10.24.1, it got solved.
I'm on In Windows 10 with node 16.
For me, the solution was either running commands
set NODE_ENV=development
$env:NODE_ENV="development"
or calling the npm install command with admin rights inside PowerShell
By the way, when I switched to node v12, it worked for me as well.

React Native Expo: Error installing masked-view

I am building an app with Expo and I want to detect if a user has internet connection, but I have trouble installing NetInfo. I tried running:
expo install #react-native-community/netinfo
but I get an error:
[14:32:00] > npm install
npm ERR! Error while executing:
npm ERR! C:\Users\myusername\AppData\Local\Programs\Git\mingw64\bin\git.EXE ls-remote -h -t ssh://git#github.com/react-native-community/masked-view.git
npm ERR!
npm ERR! undefined
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\myusername\AppData\Roaming\npm-cache\_logs\2020-02-12T13_34_44_927Z-debug.log
[14:34:44] npm exited with non-zero code: 1
[14:34:44] Set EXPO_DEBUG=true in your env to view the stack trace.
Meanwhile when I tried installing masked-view, I got:
[13:18:20] > npm install
npm ERR! Error while executing:
npm ERR! C:\Users\myusername\AppData\Local\Programs\Git\mingw64\bin\git.EXE ls-remote -h -t ssh://git#github.com/react-native-community/masked-view.git
npm ERR!
npm ERR! undefined
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\myusername\AppData\Roaming\npm-cache\_logs\2020-02-12T12_21_03_015Z-debug.log
[13:21:03] npm exited with non-zero code: 1
[13:21:03] Set EXPO_DEBUG=true in your env to view the stack trace.
Can anyone help me to find the root of this problem?
Try re-installing React Native MaskedView
yarn add #react-native-community/masked-view
or
npm install --save #react-native-community/masked-view
Feel free for doubts.
I had same issue, simply tried with below command, it works.
npm install #react-native-community/masked-view
Alternatively:
npm install --save #react-native-community/masked-view

Issues installing fabric-sdk-rest

I am trying to install hyperledger fabric sdk rest server. I have cloned fabric-sdk-rest repo and installed the prerequisites but when trying to run "npm link" in packages/loopback-connector-fabric I get the following error:
npm ERR! path /usr/lib/node_modules/loopback-connector-fabric
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall unlink
npm ERR! Error: EACCES: permission denied, unlink '/usr/lib/node_modules/loopback-connector-fabric'
npm ERR! { Error: EACCES: permission denied, unlink '/usr/lib/node_modules/loopback-connector-fabric'
npm ERR! stack: 'Error: EACCES: permission denied, unlink \'/usr/lib/node_modules/loopback-connector-fabric\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'unlink',
npm ERR! path: '/usr/lib/node_modules/loopback-connector-fabric' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2018-02-12T22_24_45_379Z-debug.log
This is what happens if I run it with sudo:
> pkcs11js#1.0.13 install /home/user/Documents/fabric-sdk-rest/packages/loopback-connector-fabric/node_modules/pkcs11js
> node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/user/Documents/fabric-sdk-rest/packages/loopback-connector-fabric/node_modules/pkcs11js/build'
gyp ERR! System Linux 4.8.0-36-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/user/Documents/fabric-sdk-rest/packages/loopback-connector-fabric/node_modules/pkcs11js
gyp ERR! node -v v9.5.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pkcs11js#1.0.13 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pkcs11js#1.0.13 install 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/user/.npm/_logs/2018-02-12T22_26_40_864Z-debug.log
This is done in Ubuntu 16.04. What am I doing wrong?
I was facing this errors too. After a while trying all kind of insane things to get it running I came into account that the problem was I was installing npm modules as superuser globally. This conflicts with hyperledger*.
Solutions is $: sudo npm uninstall -g *** for every module you just installed as superuser.
Then you need to install the modules not as superuser. This are some advices.
If installing Hyperledger Composer using Linux, be aware of the following advice:
Login as a normal user, rather than root.
Do not su to root.
When installing prerequisites, use curl, then unzip using sudo.
Run prereqs-ubuntu.sh as a normal user. It may prompt for root password as some of it's actions are required to be run as
Do not use npm with sudo or su to root to use it.
Avoid by all means installing node modules globally as root.
If you're running on Ubuntu, you can download the prerequisites using the following commands:
curl -O https://hyperledger.github.io/composer/prereqs-ubuntu.sh
chmod u+x prereqs-ubuntu.sh
Next run the script - as this briefly uses sudo during its execution, you will be prompted for your password.
$: ./prereqs-ubuntu.sh
This is the best way
Or you can visit this page and follow the prereqs installation guide.
Prerequisites for Ubuntu
and finally follow this link to continue the installation it works just fine.
Install development tools
This is the latest update
Hope this helps