How can npm install always throwing error code 1? - reactjs

Every time I use npm install it always shows this error. I have already downgraded my Node.js to the latest stable version.
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command C:\Program Files\nodejs\node.exe C:\Users\AZ PRODUCTIONS\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js install --force --cache=C:\Users\AZ PRODUCTIONS\AppData\Local\npm-cache --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! > spookyswap-sdk#1.2.0 prepare
npm ERR! > rm -rf ./dist && yarn build
I can't post more because of the limitation.

npm clear cache --force
and delete node_modules and package-lock.json
try
npm i --force

Related

npm ERR! Failed at the node-sass#4.14.1 postinstall script

I'm trying to install the npm package. However when i try to install it i get this error: npm ERR! Failed at the node-sass#4.14.1 postinstall script.
my node-sass verison is: 4.14.1
my node version is 12.14.0
I have removed package-lock.json and node_modules and cleared npm cache, and then installed the packages again but that didn't help.
Any idea what the issue is?

cannot setup react-boilerplate on mac M1

when I clone the repository and run this command "npm run start", this error occurs
npm ERR! code 1
npm ERR! path /Users/hf/Downloads/leadbook-test/node_modules/ngrok
npm ERR! command failed
npm ERR! command sh -c node ./postinstall.js
npm ERR! ngrok - platform darwinarm64 is not supported.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/hf/.npm/_logs/2022-03-09T19_45_14_908Z-debug-0.log
Try
npm cache clean --force
After that delete node_modules and package-lock.json
npm install or yarn
npm start or yarn start
Hope this will fix your issue.

npm failing with error code ETARGET when trying to install dependencies

Edit
To anyone coming here from the future, run npm get registry and make sure it's pointing to https://registry.npmjs.com.
Mine was pointing to a Nexus registry that temporarily didn't have the package I needed.
I have a basic project that a Jenkins job clones the repository of and runs,
npm install && npm run build
Eventually, it fails with the below error:
npm ERR! code ETARGET
npm ERR! notarget No matching version found for #typescript-eslint/experimental-utils#4.14.1.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of '#typescript-eslint/eslint-plugin'
npm ERR! notarget
npm ERR! A complete log of this run can be found in:
The version that is being requested exists.
I've tried everything I could think of. I tried,
omitting my yarn.lock file
switching to package-lock.json to see if that was the issue
omitting the package-lock.json
running rm -rf node_modules && rm -rf yarn.lock && npm cache clean --force && npm install && npm run build
adding #typescript-eslint/experimental-utils#4.14.1 to my dependencies in package.json
What's weird is that locally running yarn && yarn start or npm install && npm run start works just fine.
I honestly have no idea what I'm missing here, I've been pulling my hair out for hours.
I've looked at countless solutions online, but none worked for me.
$ npm -v
v6.13.4
$ node -v
v12.16.1

Installing create-react-app gives npm ERR! shasum check failed and npm ERR! Unexpected end of JSON input while parsing near '...mojOzGIEI2rg0m24Yb5Oq'

Errors when i use sudo npm install create-react-app -g
npm ERR! Linux 4.13.0-39-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "i" "create-react-app" "-g"
npm ERR! node v6.11.4
npm ERR! npm v3.5.2
npm ERR! shasum check failed for /tmp/npm-16477-77596b49/registry.npmjs.org/tar/-/tar-2.2.1.tgz
npm ERR! Expected: 8e4d2a256c0e2185c6b18ad694aec968b83cb1d1
npm ERR! Actual: 5eb06eb521673d0940a4deb11baf89d62647f193
npm ERR! From: https://registry.npmjs.org/tar/-/tar-2.2.1.tgz
when use npm install create-react-app
- npm-version : 6.0.0
- node-version: 8.11.1
error is:
npm ERR! Unexpected end of JSON input while parsing near '...mojOzGIEI2rg0m24Yb5Oq'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/dilipcoder/.npm/_logs/2018-05-05T11_34_14_721Z-debug.log
i have already tried these options
npm cache clean --force
reinstalling npm and node
switching different version of npm
error which I get while installing create-react-app other packages installed properly
the error npm ERR! shasum check failed and npm ERR! Unexpected end of JSON input while parsing near'....' , will be solved by switching npm reigistry from the list of given npm registry.
List of Npm registry:
https://registry.npmjs.org/ (Dfault One)
http://r.cnpmjs.org/
https://registry.npm.taobao.org/
https://registry.nodejitsu.com/
http://registry.mirror.cqupt.edu.cn
https://skimdb.npmjs.com/registry
https://npm.open-registry.dev/ (https://open-registry.dev)
To switch just type
npm config set registry "https://registry.npmjs.com/"
Replace the registry url with the above urls check which one works for you.
After That:
npm cache clear --force
npm cache verify
now error will be solved.
"npm cache clean --force" didn't work for me but removing package-lock.json worked.
https://github.com/vuejs-templates/webpack/issues/990#issuecomment-395750082
Error:
SyntaxError: Unexpected end of JSON input while parsing near
Removing package-lock.json worked for me.
Add Powershell script or Linux script as below,
Powershell:
Remove-Item package-lock.json -Force
Linux:
rm -rf package-lock.json
Path In Azure Devops:
$(System.DefaultWorkingDirectory)\appName\appName\ClientApp\node_modules'
Note - appName is an example you can add a path as per your source code.

How to install Blur Admin?

I have been trying to install blur-admin via (git clone https://github.com/akveo/blur-admin.git). But when I install it from git bash as mentioned in the installation guide it shows the following error:
bower ECONFLICT Unable to
find suitable version for angular
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program
Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v4.4.5
npm ERR! npm v2.15.5
npm ERR! code ELIFECYCLE
npm ERR! blur_admin#1.2.0 postinstall: bower install npm ERR! Exit
status 1 npm ERR! npm ERR! Failed at the blur_admin#1.2.0 postinstall
script 'bower install'.
npm ERR! This is most likely a problem with the blur_admin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! bower install
npm ERR! You can get information on how to open an issue for this
project with:
npm ERR! npm bugs blur_admin
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm ERR! npm owner ls blur_admin
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\xampp\htdocs\blur-admin\npm-debug.log
The issue is because Bower is not installed in your Windows Machine.
Try to install bower before installing this AngularJs template.
Use the following command to install bower:
npm install -g bower
Also check if Gulp - Task automation tool is install or not.
Use the following command to install the same:
npm install -g gulp
Now use npm install to install the project and its Package Dependencies.
To run the application:
gulp serve
Sorry I got a little bit late.
Did you try to move the /bower_components/ folder from the /client/ directory to your root project directory? That worked for me.
First
npm i -g npm
Then delete everything in node_modules. When those are deleted, cd to your directory and
npm install
Worked for me. If you are on OSX or Linux, use sudo.
If you are on Windows, make sure you're running as administrator.
The issue is from Bower, as Bower is not installed into the system.
First install the bower by following:
npm install -g bower
Then run the app by :
gulp serve

Resources