Gulp not found, also not allowing to install - npm

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.

Related

I'm trying to download Sanity for this particular project but for some reason on the terminal it's showing this

I'm trying to install Sanity for this project but I'm having trouble installing it and it shows this.
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/#sanity
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/#sanity'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/#sanity'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/#sanity'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
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! /Users/****/.npm/_logs/2022-08-03T22_03_07_802Z-debug-0.log
zsh: command not found: sanity

Can't upgrade npm from "npm install -g npm#latest" command

$ npm install -g npm#latest
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js\
/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js\
npm ERR! code EACCES\
npm ERR! syscall mkdir\
npm ERR! path /usr/local/share/man/man1\
npm ERR! errno -13\
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/share/man/man1'\
npm ERR! { [Error: EACCES: permission denied, mkdir '/usr/local/share/man/man1']\
npm ERR! cause:\
npm ERR! { Error: EACCES: permission denied, mkdir '/usr/local/share/man/man1'\
npm ERR! errno: -13,\
npm ERR! code: 'EACCES',\
npm ERR! syscall: 'mkdir',\
npm ERR! path: '/usr/local/share/man/man1' },\
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, mkdir \'/usr/local/share/man/man1\'',\
npm ERR! errno: -13,\
npm ERR! code: 'EACCES',\
npm ERR! syscall: 'mkdir',\
npm ERR! path: '/usr/local/share/man/man1' }\
npm ERR! \
npm ERR! The operation was rejected by your operating system.\
npm ERR! It is likely you do not have the permissions to access this file as the current user\
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! /home/katha/.npm/_logs/2021-05-13T12_20_16_050Z-debug.log

Upgrading npm, npm ERR! Error: EACCES: permission denied

Command: npm install -g npm#latest
Result:
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/string-width
npm ERR! dest /usr/local/lib/node_modules/.staging/string-width-fa87d55b
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/string-width' -> '/usr/local/lib/node_modules/.staging/string-width-fa87d55b'
npm ERR! [OperationalError: EACCES: permission denied, rename '/usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/string-width' -> '/usr/local/lib/node_modules/.staging/string-width-fa87d55b'] {
npm ERR! cause: [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/string-width' -> '/usr/local/lib/node_modules/.staging/string-width-fa87d55b'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/string-width',
npm ERR! dest: '/usr/local/lib/node_modules/.staging/string-width-fa87d55b'
npm ERR! },
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/string-width',
npm ERR! dest: '/usr/local/lib/node_modules/.staging/string-width-fa87d55b'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
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! /home/surendra/.npm/_logs/2021-05-06T12_41_30_866Z-debug.log
Run NPM package as administrator by using sudo
sudo npm install -g npm#latest

Error installing package gulp nodejs

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

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