Error installing package gulp nodejs - npm

Getting Error: EACCES, rmdir '/usr/local/lib/node_modules/gulp' while trying to install gulp
npm install gulp -g
Tried running with Administrator ( sudo ) but still can't get it to install.
npm ERR! Error: EACCES, rmdir '/usr/local/lib/node_modules/gulp'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, rmdir '/usr/local/lib/node_modules/gulp']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/gulp' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES, rmdir '/usr/local/lib/node_modules/gulp'
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EACCES, rmdir '/usr/local/lib/node_modules/gulp']
npm ERR! error rolling back errno: -13,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/gulp' }
npm ERR! Please include the following file with any support request:
npm ERR! /Users/giridhar/Work/Node/npm-debug.log

Related

npm ERR code EPERM syscall unlink while executing npm install

Got the following error while executing npm install
node version 12.16.2
Running cmd as administrator
npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path D:\Projects\BTP\Medical-Project\client\node_modules\.staging\npm-9e4fc1a9\man\man5\package-locks.5
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink 'D:\Projects\BTP\Medical-Project\client\node_modules\.staging\npm-9e4fc1a9\man\man5\package-locks.5'
npm ERR! [OperationalError: EPERM: operation not permitted, unlink 'D:\Projects\BTP\Medical-Project\client\node_modules\.staging\npm-9e4fc1a9\man\man5\package-locks.5'] {
npm ERR! cause: [Error: EPERM: operation not permitted, unlink 'D:\Projects\BTP\Medical-Project\client\node_modules\.staging\npm-9e4fc1a9\man\man5\package-locks.5'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'D:\\Projects\\BTP\\Medical-Project\\client\\node_modules\\.staging\\npm-9e4fc1a9\\man\\man5\\package-locks.5'
npm ERR! },
npm ERR! stack: "Error: EPERM: operation not permitted, unlink 'D:\\Projects\\BTP\\Medical-Project\\client\\node_modules\\.staging\\npm-9e4fc1a9\\man\\man5\\package-locks.5'",
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'D:\\Projects\\BTP\\Medical-Project\\client\\node_modules\\.staging\\npm-9e4fc1a9\\man\\man5\\package-locks.5',
npm ERR! parent: 'client'
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\kz\AppData\Roaming\npm-cache\_logs\2021-04-01T18_15_01_424Z-debug.log
I tried :
npm cache clean --force
deleted node_modules and installed again
disabled antivirus
Restarting laptop :)
I was able to fix this by
Closing any open prompts and editors eg. VSCode.
Opening the terminal or CMD as admin and running npm-install again.
I think the IDE is 'locking a file'.

npm ERR! errno -4048

After 1 week break, I opened my pc again and when I want to 'expo start' from command window I get error like " 'expo' is not recognized as an internal or external command,operable program or batch file. " . And I tried to uninstall and install expo again and when I call " npm install --global expo-cli " I got this error.
npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path C:\Users\tuna\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\.xdl.DELETE\binaries\windows\adb\AdbWinUsbApi.dll
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\tuna\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\.xdl.DELETE\binaries\windows\adb\AdbWinUsbApi.dll'
npm ERR! [OperationalError: EPERM: operation not permitted, unlink 'C:\Users\tuna\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\.xdl.DELETE\binaries\windows\adb\AdbWinUsbApi.dll'] {
npm ERR! cause: [Error: EPERM: operation not permitted, unlink 'C:\Users\tuna\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\.xdl.DELETE\binaries\windows\adb\AdbWinUsbApi.dll'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'C:\\Users\\tuna\\AppData\\Roaming\\npm\\node_modules\\expo-cli\\node_modules\\#expo\\.xdl.DELETE\\binaries\\windows\\adb\\AdbWinUsbApi.dll'
npm ERR! },
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'C:\\Users\\tuna\\AppData\\Roaming\\npm\\node_modules\\expo-cli\\node_modules\\#expo\\.xdl.DELETE\\binaries\\windows\\adb\\AdbWinUsbApi.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\tuna\AppData\Roaming\npm-cache\_logs\2020-10-03T15_36_23_690Z-debug.log
I couldnt find any solution that looks like my problem. Anybody has an idea to solve this problem.
Thanks in advance.

Gulp not found, also not allowing to install

I have this come back in the terminal. Did have gulp previously, so not sure why it's not being found when inputting "gulp -v"
$ npm install -g gulp
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "gulp"
npm ERR! node v4.2.6
npm ERR! npm v2.14.12
npm ERR! path /usr/local/lib/node_modules/gulp
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall rmdir
npm ERR! Error: EACCES: permission denied, rmdir '/usr/local/lib/node_modules/gulp'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, rmdir '/usr/local/lib/node_modules/gulp']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rmdir',
npm ERR! path: '/usr/local/lib/node_modules/gulp' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES: permission denied, rmdir '/usr/local/lib/node_modules/gulp'
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EACCES: permission denied, rmdir '/usr/local/lib/node_modules/gulp']
npm ERR! error rolling back errno: -13,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back syscall: 'rmdir',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/gulp' }
npm ERR! Please include the following file with any support request:
npm ERR! /Users/applesandoranges0609/npm-debug.log
To install the Gulp command line utility you have to run
npm i -g gulp-cli
not just gulp. That's the dependency that should be added to projects so you can run gulp from the projects node_modules folder instead.

npg sudden error installing things

When I try to install npm install _____ I get this weird error I've never seen before. I opened powershell as admin and tried there, but got the same error. Also tried installing in safe mode, turning off many programs, npm cache clean --force, deleting and re-installing npm, cmd as admin, and many other things...
It was working fine last night, but when I woke up it stopped working....
PS Z:\myapp> npm install #google/maps
npm ERR! path Z:\myapp\node_modules\fsevents\node_modules\abbrev\package.json
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'Z:\myapp\node_modules\fsevents\node_modules\abbrev\package.json'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, unlink 'Z:\myapp\node_modules\fsevents\node_modules\abbrev\package.json'
npm ERR! at Error (native)
npm ERR! stack: 'Error: EPERM: operation not permitted, unlink \'Z:\\myapp\\node_modules\\fsevents\\node_modules\\abbrev\\package.json\'\n at Error (native)',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'Z:\\myapp\\node_modules\\fsevents\\node_modules\\abbrev\\package.json' }
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! C:\Users\AppData\Roaming\npm-cache\_logs\2017-09-12T13_11_39_774Z-debug.log
It freezes at postinstall: info lifecycle #types/googlemaps#3.26.20~postinstall: #types/googlemaps#3.26.20 then eventually just crashes totally.
Try using --no-optional while installing any package.
npm install nodemon --no-optional

npm not installing bower on OSX 10.10.1

Anybody know how to fix this?
/Users/foo $npm install -g bower
npm http request GET https://registry.npmjs.org/bower
npm http 200 https://registry.npmjs.org/bower
npm http fetch GET https://registry.npmjs.org/bower/-/bower-1.3.12.tgz
npm http fetch 200 https://registry.npmjs.org/bower/-/bower-1.3.12.tgz
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! path /Users/foo/.node/bin/bower
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! Error: EACCES, unlink '/Users/foo/.node/bin/bower'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, unlink '/Users/foo/.node/bin/bower'
npm ERR! errno: -13,
npm ERR! code: 'EACCES'
npm ERR! path: '/Users/foo/.node/bin/bower' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES, unlink'/Users/foo/.node/bin/bower'
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EACCES, unlink '/Users/foo/.node/bin/bower']
npm ERR! error rolling back errno: -13,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/Users/foo/.node/bin/bower' }
``
npm ERR! Please include the following file with any support request:
npm ERR! /Users/foo/npm-debug.log
/Users/foo$echo $PATH
/Users/foo/.npm:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/mysql/bin
:/opt/X11/bin:/usr/local/share/npm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
Have you tried running it as Root user? try
sudo npm install -g bower
The npm ERR! code EACCES usually results because it didn't have permission to access a necessary folder or file