Can't install packages for Hardhat project - npm

I wanted to create a project using Hardhat environment. I've tried following https://hardhat.org/getting-started/ tutorial from their side. In there, we have a TIP to install all required packages. Unfortunately when I run npm install --save-dev #nomiclabs/hardhat-waffle ethereum-waffle chai #nomiclabs/hardhat-ethers ethers first I can see a lot of warnings about deprecated packages and then
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t https://github.com/ethereumjs/ethereumjs-abi.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\(path)
I've tried installing ethereum-waffle with specific version selected etc. it always ends with the same error.
Do you know how to overcome it? Why so many packages are deprecated during install? Is this getting-started outdated and I should start hardhat project in some other way?

When you run npm install --save-dev #nomiclabs/hardhat-waffle ethereum-waffle chai #nomiclabs/hardhat-ethers ethers , you are installing both. The #nomicfoundation/hardhat-chai-matchers plugin is meant to be a drop-in replacement for the #nomiclabs/hardhat-waffle plugin. So having just one is okay. I recommend you to migrate and use the Hardhat Chai Matchers plugin.
Use this link for more information. => "https://hardhat.org/hardhat-chai-matchers/docs/migrate-from-waffle". I hope this helps out a little bit.

Related

How can i solve npm error on install -g yarn?

i want to run this command and install yarn
npm install -g yarn
but i get this error
npm ERR! code ENOENT
npm ERR! syscall spawn bash
npm ERR! path C:\Users\DigiMax\AppData\Roaming\npm\node_modules\yarn
npm ERR! errno -4058
npm ERR! enoent spawn bash ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\DigiMax\AppData\Local\npm-cache\_logs\2021-07-03T15_03_24_683Z-debug.log
how can i solve this problem?
The quickest solution is npm cache clean and npm cache verify works in most cases.
According to docs.npmjs you should check your npm version and update if needed or reinstall it at worst.
Please, let us know if it worked
This problem solve by "running VSCode as administrator"

Not able to install apisauce in react-native project

I tried to install using the following code:
npm i apisauce --save
However, I got these errors:
npm WARN react-navigation-stack#2.8.2 requires a peer of
react-navigation#^4.1.1 but none is installed. You must install peer
dependencies yourself.
npm ERR! code ENOENT npm ERR! syscall rename npm ERR! path
F:\DoneWithIt\node_modules\follow-redirects\node_modules\debug npm
ERR! dest
F:\DoneWithIt\node_modules\follow-redirects\node_modules.debug.DELETE
npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or
directory, rename
'F:\DoneWithIt\node_modules\follow-redirects\node_modules\debug' ->
'F:\DoneWithIt\node_modules\follow-redirects\node_modules.debug.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\Ravi\AppData\Roaming\npm-cache_logs\2020-08-01T13_33_29_249Z-debug.log
I was stuck on this same issue today and I think I fixed it just now. I followed the suggestions of uninstalling nodejs (and the node_modules folder if that doesn't also get automatically removed with it), making sure that your nodejs folder is in the environment variables path.
The stackoverflow thread I referenced is: Fixing npm path in Windows 8 and 10

The development server returned error code 500

I want to run react-navigation.
It gives me this error for gesture handler. While I'm going to install gesture handler, the following error occurs.
Kindly give me the appropriate solution.
C:\Users\Farooq\FirstActivity>npm install --save react-native-gesture-handler
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t https://github.com/naver/hammer.js.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Farooq\AppData\Roaming\npm-cache\_logs\2020-02-11T21_17_29_196Z-debug.log
This is typical issue with windows environment.
First of all download git for windows from here
Then follow bellow steps
Open Your Environment Variables
Edit Path
Find your git location that been installed in your device. Example is C:\Program Files\Git\cmd
Add the git location to Path (make sure to add this to both user variables and system variables)
Apply the changes and restart your pc
Lastly, go back to your project and run npm install react-native-gesture-handler

What should be the solution of the following problem?

I am trying to create a new React-Native project but I am getting the following error stack trace:
C:\Users\MY HP\Desktop\MyProjects\ReactNative\project01>expo init RunAtleast
? Choose a template: expo-template-blank
√ Please enter a few initial configuration values.
Read more: https://docs.expo.io/versions/latest/workflow/configuration/ · 100% completed
Extracting project files...
Customizing project...
Installing dependencies...
npm WARN deprecated core-js#1.2.7: core-js#<2.6.5 is no longer maintained. Please, upgrade to core-js#3 or at least to actual version of core-js#2.
npm ERR! path git
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn git
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git#github.com/expo/react-native-maps.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\MY HP\AppData\Roaming\npm-cache\_logs\2019-04-04T18_59_55_657Z-debug.log
Process exited with non-zero code: 1
Set EXPO_DEBUG=true in your env to view the stack trace.
Does anyone have any ideas on how to fix this error? Any help would be greatly appreciated!
Looks like the problem is with your installation of git under Windows. A quick search turned up this link: https://github.com/amplience/cms-javascript-sdk/issues/1
Perhaps you can find more ideas how to fix this following the discussion there?
It has been solves as I used npm cache clear --force and reinstalled npm install -g expo-cli. And the problem gets solved..thanks to the stackovelflow community for such types of help..

npm install fail -- error message: enoent ENOENT: no such file or directory

i'm building an Vue.js project using vue init webpack project_name,after this step I ran npm install. and npm threw out errors below:
npm ERR! path /Users/duodian/Desktop/crop-demo/node_modules/js-
beautify/js/bin/css-beautify.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod
'/Users/duodian/Desktop/crop-demo/node_modules/js-beautify/js/bin/css-beautify.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/duodian/.npm/_logs/2017-09-18T09_55_20_047Z-debug.log
node version 8.5.0
npm version 5.3.0
Note: I just updated my macOS HighSierra to 10.13 Beta, does this affect?
had any friends have this problem?
Running
npm install js-beautify#1.6.14
and then
npm install (assuming that you are installing deps in package.json)
worked for me. Got it from here.
https://github.com/beautify-web/js-beautify/issues/1247
It's bacause of js-beautify#1.7 i broken. So, try to downgrade vue-cli to 2.7.0 is a temporary workaround to solving this problem
npm install -g vue-cli#2.7.0