Unable to install Netlify-Cli - node.js

i was trying to install Netlify-Cli using Linux Terminal.
I tried this command:
npm install netlify-cli -g
But it is throwing some error
> yarn#1.22.10 preinstall /usr/local/lib/node_modules/netlify-cli/node_modules/yarn
> :; (node ./preinstall.js > /dev/null 2>&1 || true)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.3.2 (node_modules/netlify-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: #netlify/traffic-mesh-agent-win32-x64#0.27.10 (node_modules/netlify-cli/node_modules/#netlify/traffic-mesh-agent-win32-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for #netlify/traffic-mesh-agent-win32-x64#0.27.10: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: #netlify/traffic-mesh-agent-darwin-x64#0.27.10 (node_modules/netlify-cli/node_modules/#netlify/traffic-mesh-agent-darwin-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for #netlify/traffic-mesh-agent-darwin-x64#0.27.10: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/netlify-cli/bin/run
npm ERR! dest /usr/local/bin/netlify
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/netlify-cli/bin/run' -> '/usr/local/bin/netlify'
npm ERR! { [Error: EACCES: permission denied, symlink '../lib/node_modules/netlify-cli/bin/run' -> '/usr/local/bin/netlify']
npm ERR! cause:
npm ERR! { Error: EACCES: permission denied, symlink '../lib/node_modules/netlify-cli/bin/run' -> '/usr/local/bin/netlify'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/netlify-cli/bin/run',
npm ERR! dest: '/usr/local/bin/netlify' },
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, symlink \'../lib/node_modules/netlify-cli/bin/run\' -> \'/usr/local/bin/netlify\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/netlify-cli/bin/run',
npm ERR! dest: '/usr/local/bin/netlify' }
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/silence/.npm/_logs/2021-05-09T13_28_21_198Z-debug.log
If any small help would be helpful.

Thanks to boirslav popov.
As he mentioned in his answer it has worked for some of them ie,
sudo npm install netlify-cli -g
But sadly it didn't work for me :(
For those, if the above command didn't work can follow the attached answer :D
Answer
I followed this answer
i.e,
sudo npm install -g --unsafe-perm=true netlify-cli

See this: https://answers.netlify.com/t/errors-with-netlify-cli/26842
Your user does not have sufficient permissions.

Im using a Mac.
So I actually had to go into my library folder and manually delete the netlify folder.
I then reinstalled the netlify cli via brew:
brew reinstall netlify-cli
This way you dont get all the permissions errors. In general this is seems like the best way to do things on mac when dealing with a cli.
It would be good to know why Mac gets mad at just using the global npm install tho.

Related

Nodemon install problem. when i am install nodemon in my node js

saif#saifrakib:~/Project/NodeJs/second-node$ npm install -g nodemon
npm WARN checkPermissions Missing write access to /usr/local/lib
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.3.2 (node_modules/nodemon/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib'
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, access '/usr/local/lib'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib' }
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/saif/.npm/_logs/2021-10-22T09_54_02_012Z-debug.log
Change your file permissions.
sudo chown -R $USER /usr/local/lib/node_modules
Or please check the below link
Error: EACCES: permission denied, access '/usr/local/lib/node_modules'

install a language server lspconfig

When i execute the npm i -g typescript typescript-language-server this is what the terminal return and dont install the language
npm WARN checkPermissions Missing write access to /usr/local/lib<br>
npm WARN notsup Unsupported engine for fs-extra#10.0.0: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})<br>
npm WARN notsup Not compatible with your version of node/npm: fs-extra#10.0.0<br>
npm ERR! code EACCES<br>
npm ERR! syscall access<br>
npm ERR! path /usr/local/lib<br>
npm ERR! errno -13<br>
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib'<br>
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib']<br>
npm ERR! stack:<br>
npm ERR! 'Error: EACCES: permission denied, access \'/usr/local/lib\'',<br>
npm ERR! errno: -13,<br>
npm ERR! code: 'EACCES',<br>
npm ERR! syscall: 'access',<br>
npm ERR! path: '/usr/local/lib' }<br>
npm ERR! <br>
npm ERR! The operation was rejected by your operating system.<br>
npm ERR! It is likely you do not have the permissions to access this file as the current user<br>
npm ERR!<br>
npm ERR! If you believe this might be a permissions issue, please double-check the<br>
npm ERR! permissions of the file and its containing directories, or try running<br>
npm ERR! the command again as root/Administrator.<br>
npm ERR! A complete log of this run can be found in:<br>
npm ERR! /home/alfredo/.npm/_logs/2021-07-29T22_20_46_385Z-debug.log'<br>
It’s a permission error, which means you don’t have write access to /usr/local/lib folder.
To solve it. Run this command:
sudo chown -R $USER /usr/local/lib

How to install Angular IDE in ubuntu?

I am angular2 beginner. I am try to install angular IDE in my won system but it does not install.
Command : -
npm install -g angular-ide
error:-
npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules/angular-ide/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 4.4.0-75-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "angular-ide"
npm ERR! node v7.8.0
npm ERR! npm v4.2.0
npm ERR! path ../lib/node_modules/angular-ide/bin/ngide
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/angular-ide/bin/ngide' -> '/usr/bin/ngide'
npm ERR! { Error: EACCES: permission denied, symlink '../lib/node_modules/angular-ide/bin/ngide' -> '/usr/bin/ngide'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/angular-ide/bin/ngide',
npm ERR! dest: '/usr/bin/ngide' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /home/iron/.npm/_logs/2017-05-01T03_32_46_250Z-debug.log
Please tell us how to install angular IDE?
sudo npm install -g angular-ide
Its says access problem , so try this .
step 1:
cd /home/user/Downloads
step 2:
chmod +x angularide-ci-2020.7.22-offline-installer-linux.run
step 3:
./angularide-ci-2020.7.22-offline-installer-linux.run
step 4:
it will launch the widget
step 5:
Follow the instructions
step 6:
Done

"npm install -g express-generator" using this command on Ubuntu 16.04

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules/nodemon/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 4.4.0-62-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/local/bin/npm" "install" "nodemon" "-g"
npm ERR! node v4.2.6
npm ERR! npm v4.2.0
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /home/santosh/.npm/_logs/2017-02-23T05_20_16_087Z-debug.log
use sudo npm install -g express-generator
Try to run the npm command with sudo or follow the steps provided in this video: https://docs.npmjs.com/all#fixing-npm-permissions

ionic serve is not working after upgrading node.js and ionic

I upgraded node.js and npm and did an npm install and now I'm getting the message below. The thing is, I have been working on the application for about a year and gulp-sass is installed (it's what I use to upgrade my sass files) so it is clearly do to the upgrade, but I'm not sure how to get everything to work again, sort of downgrading everything again.
$ ionic serve
Uh oh! Looks like you're missing a module in your gulpfile:
Cannot find module 'gulp-sass'
Do you need to run `npm install`?
When I try npm install gulp-sass:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.0.17: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN enoent ENOENT: no such file or directory, open 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\gulp-minify-css\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\karma-junit-reporter\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\karma-mocha-reporter\package.json'
npm WARN rcreditsmobile#1.1.1 No repository field.
npm WARN rcreditsmobile#1.1.1 No license field.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Users\\Public\\Programs\\nodejs\\node.exe" "C:\\Users\\Someone\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "gulp-sass" "--save"
npm ERR! node v6.9.5
npm ERR! npm v4.2.0
npm ERR! path E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\node-sass
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\node-sass' -> 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\.node-sass.DELETE'
npm ERR! at moveAway (C:\Users\Someone\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:42:5)
npm ERR! at destStatted (C:\Users\Someone\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:31:7)
npm ERR! at C:\Users\Someone\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:287:18
npm ERR! at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\node-sass' -> 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\.node-sass.DELETE'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, rename 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\node-sass' -> 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\.node-sass.DELETE'
npm ERR! at moveAway (C:\Users\Someone\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:42:5)
npm ERR! at destStatted (C:\Users\Someone\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:31:7)
npm ERR! at C:\Users\Someone\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:287:18
npm ERR! at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\node-sass' -> 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\.node-sass.DELETE'
npm ERR! at Error (native) parent: 'rcreditsmobile' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Someone\AppData\Roaming\npm-cache\_logs\2017-02-11T01_17_29_643Z-debug.log
I found an answer on the ionic forum that works, the relevant part is below with a few modifications for clarity:
Just add this to your gulpfile.js
gulp.task('serve:before', ['default']);
That line tells the new ionic 2 client to run the old ionic 1.x client
'default' task before serving (before running ionic serve)
Also you need to add your ionic.config.json file this:
{
...
"app_id": "",
"v2": false,
"typescript": false,
"watch": {
"sass": ["scss/**/*.scss"],
"html": ["www/**/*.html"],
"livereload": [
"www/**/*.html",
"www/**/*.js",
"www/**/*.css"
]
}
...
}
Ref: https://forum.ionicframework.com/t/ionic2-cli-doesnt-run-gulp-tasks-on-ionic-serve/49085/7
I've encountered this problem before. What I've tried so far:
Reinstall the node.js. You may refer https://nodejs.org/en/download/
Run in command line: npm rebuild node-sass
Then try run ionic serve. Hope it helps you.

Resources