Can't install netfily-cli -g

When I try to install npm install netfily-cli -g, I get an error. I tried reinstalling npm, updating, uninstalling. in the node_modules folder I have no netlifs
.
$ npm remove netlify-cli
npm WARN tsutils@3.17.1 requires a peer of typescript @> = 2.8.0 || > = 3.2.0-dev || > = 3.3.0-dev || > = 3.4.0-dev || > = 3.5.0-dev || > = 3.6.0-dev || > = 3.6.0-beta || > = 3.7.0-dev || > = 3.7.0-beta but none is installed. You must install peer dependencies yourself.
audited 1918 packages in 6.003s
81 packages are looking for funding
run npm fund for details
found 0 vulnerabilities

if I want to install it after a long download it gives such an error.

$ npm install netlify-cli -g
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated object-keys@0.2.0: Please update to the latest object-keys

yarn@1.22.10 preinstall C: \ Users \ Slov \ AppData \ Roaming \ npm \ node_modules \ netlify-cli \ node_modules \ yarn
:; (node ​​./preinstall.js> / dev / null 2> & 1 || true)

npm WARN rollback Rolling back is-accessor-descriptor@1.0.0 failed (this is probably harmless): EPERM: operation not permitted, lstat ‘C: \ Users \ Slov \ AppData \ Roaming \ npm \ node_modules \ netlify-cli \ node_modules \ define-property \ node_modules’
npm WARN rollback Rolling back p-map@2.1.0 failed (this is probably harmless): EPERM: operation not permitted, lstat ‘C: \ Users \ Slov \ AppData \ Roaming \ npm \ node_modules \ netlify-cli \ node_modules \ p -all \ node_modules’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules \ netlify-cli \ node_modules \ rollup \ node_modules \ fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {“os”: “darwin”, “arch”: “any”} (current: {“os”: “win32”, “arch”: “x64”})

npm ERR! code EEXIST
npm ERR! path C: \ Users \ Slov \ AppData \ Roaming \ npm \ node_modules \ netlify-cli \ bin \ run
npm ERR! dest C: \ Users \ Slov \ AppData \ Roaming \ npm \ ntl
npm ERR! EEXIST: file already exists, cmd shim ‘C: \ Users \ Slov \ AppData \ Roaming \ npm \ node_modules \ netlify-cli \ bin \ run’ -> ‘C: \ Users \ Slov \ AppData \ Roaming \ npm \ ntl’
npm ERR! File exists: C: \ Users \ Slov \ AppData \ Roaming \ npm \ ntl
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:
npm ERR! C: \ Users \ Slov \ AppData \ Roaming \ npm-cache \ _logs \ 2020-10-21T15_20_08_296Z-debug.log

hi @Slov666! Have you looked through the issues here? If your problem isn’t described there, the best way to get help with very specific CLI problems is to file a new issue.

Thanks!

Try
npm cache clean --force then installing, if that doesn’t work, I had to go into my node_modules, delete them and then try to install, then it worked.

I followed answers from here:

Yes, I have tried this.
But I install globally. And in my node_module folder there is no netlify-cli (

if youre on windows search %Appdata% in bottom left, then you should be in user/name/appdata/roaming
then go to npm and you should see node_modules?

No, I don’t see him. This is what I’m talking about

Hi, @Slov666. There is no screenshot attached. What do you see locally?

The error you sent says this:

npm ERR! File exists: C: \ Users \ Slov \ AppData \ Roaming \ npm \ ntl
npm ERR! Remove the existing file and try again, or run npm

I would look for this file/directory and delete it if you find it:

  • C:\Users\Slov\AppData\Roaming\npm\ntl

If that doesn’t work or if there are other questions, please let us know.

Hello! I finally managed to solve the problem. Thank you very much !

i deleted these files together
npm ERR! File exists: C:\Users\Slov\AppData\Roaming\npm\netlify
npm ERR! File exists: C:\Users\Slov\AppData\Roaming\npm\ntl

Hi, @Slov666. Thank you for sharing the solution you found.

I have latest nodejs. But I am not able to install Netlify CLI. It gives an error. The screenshot is attached. Please help!!

Hi, @Avadhoot. The error message says that this is an issue being caused by your operating system and it looks like a filesystem permission issue.

You will need to troubleshoot your local system to find out why it isn’t allowing you to install it. This StackOverflow post might help:

If there are other questions about this, please let us know.

1 Like

Thanks @luke :smile: It was a system permission issue I guess. Resolved by running CMD as administrator and could install Netlify CLI.

2 Likes