Why does it give an error when I run 'npm install' in my terminal? - npm-install

PS C:\Users\JOEKINZ\Desktop\theaccrahandyman\budgettracker\frontend> npm install
npm ERR! cb.apply is not a function
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\JOEKINZ\AppData\Roaming\npm-cache_logs\2022-06-29T09_51_40_878Z-debug.log

Related

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 app: npm run build throws "sh: cross-env: command not found" even after running npm i

I have been unable to run the command npm run build unsuccessfully, I get the following issue:
> #myer-online/frontend#1.0.0 build /Users/surbhimidha/myer-online
> cross-env NODE_ENV=production next build
sh: cross-env: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! #myer-online/frontend#1.0.0 build: `cross-env NODE_ENV=production next build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the #myer-online/frontend#1.0.0 build 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! /Users/surbhimidha/.npm/_logs/2021-02-10T08_06_42_019Z-debug.log
I am using the following versions of node and npm:
npm: 6.14.8
node: 14.13.1
I have tried to delete node modules and run npm i but still I get the above error when I run npm run build
I noticed that cross-env is not present under /node_modules/.bin
Please help!

npm start isn't working, react-native app

im trying to build react-native app.
running the commands on gitBash, windows10.
when im trying to run 'npm start' im getting this error:
Fixed , just installed again expo-cli in the rn-starter folder, thanks for the answers :)
$ npm start
> # start C:\Users\Liran\food
> expo start
'expo-cli' is not recognized as an internal or external command,
operable program or batch file.
This command requires Expo CLI.
Do you want to install it globally [Y/n]? Y
Installing the package 'expo-cli'...
npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path C:\Users\Liran\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\Liran\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll'
npm ERR! [OperationalError: EPERM: operation not permitted, unlink 'C:\Users\Liran\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll'] {
npm ERR! cause: [Error: EPERM: operation not permitted, unlink 'C:\Users\Liran\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'C:\\Users\\Liran\\AppData\\Roaming\\npm\\node_modules\\expo-cli\\node_modules\\#expo\\.xdl.DELETE\\binaries\\windows\\adb\\AdbWinApi.dll'
npm ERR! },
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'C:\\Users\\Liran\\AppData\\Roaming\\npm\\node_modules\\expo-cli\\node_modules\\#expo\\.xdl.DELETE\\binaries\\windows\\adb\\AdbWinApi.dll',
npm ERR! parent: 'expo-cli'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Liran\AppData\Roaming\npm-cache\_logs\2020-10-19T09_36_58_255Z-debug.log
Installing Expo CLI failed. You can install it manually with:
npm install --global expo-cli
npm ERR! code ELIFECYCLE
npm ERR! errno 4294963248
npm ERR! # start: `expo start`
npm ERR! Exit status 4294963248
npm ERR!
npm ERR! Failed at the # start 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! C:\Users\Liran\AppData\Roaming\npm-cache\_logs\2020-10-19T09_36_58_348Z-debug.log
help please someone :)
Open windows terminal as Administrator and run command:
install --global expo-cli
then from the root of your project you can either run expo start or npm start both will do.
You need to install Expo CLI package.
see: https://docs.expo.io/workflow/expo-cli/
install:
npm install -g expo-cli
If you still getting same error do these two steps;
Be sure about working on terminal as administrator
If you're using an antivirus program, STOP it while trying to execute above command.

Why I'm seeing this when I do npm install

After running npm I'm seeing this error. How do I resolve it?
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! puppeteer#1.20.0 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the puppeteer#1.20.0 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! C:\Users\AppData\Roaming\npm-cache\_logs\2020-04-17T15_35_46_212Z-debug.log
I ran:
npm install puppeteer --unsafe-perm=true --allow-root
but it didn't help.
Run this command:
npm config set puppeteer_skip_chromium_download true -g
And then try to install again
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm install puppeteer
helped me

npm intstall: binding.node is missing

I tried to install npm on my local machine (Mac OS) but when I run npm start, it keeps giving me this error with node_sass. Even when I run
sudo npm install node_sass
it doesn't fix the problem.
Error: You probably need to execute `npm install` to install brunch plugins.
Error: `/Users/AnhLe/bloc/anh-jams/node_modules/sass-brunch/node_modules/node-sass/bin/darwin-x64-v8-3.28/binding.node` is missing. Try reinstalling `node-sass`?
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "start"
npm ERR! node v0.12.0
npm ERR! npm v2.7.3
npm ERR! code ELIFECYCLE
npm ERR! bloc-rdio-skeleton#0.0.1 start: `brunch watch --server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bloc-rdio-skeleton#0.0.1 start script 'brunch watch --server'.
npm ERR! This is most likely a problem with the bloc-rdio-skeleton package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! brunch watch --server
npm ERR! You can get their info via:
npm ERR! npm owner ls bloc-rdio-skeleton
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/AnhLe/bloc/anh-jams/npm-debug.log
Looked around and these people are experiencing a similar error due to binding.node missing from SASS.
https://github.com/dlmanning/gulp-sass/issues/185