CopyPastor

Detecting plagiarism made easy.

Score: 0.8167083263397217; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2020-02-12
by Leandro Matilla

Original Post

Original - Posted on 2018-04-10
by CTS\_AE



            
Present in both answers; Present only in the new answer; Present only in the old answer;

1) Delete the NPM Folder globally
How to: https://stackoverflow.com/a/5926706/349659
```npm list -g```
For Windows this will most likely be:
```%AppData%\npm\node_modules```
You can paste that into a folder's address bar and it will take you there.
Once there delete the folder named **npm**.
---
2) Download the latest Release of NPM
https://github.com/npm/cli/releases/latest
Grab the zip and unzip it to your ```node_modules``` folder that you just deleted the npm folder from.
Rename the folder you extracted from the zip to **npm**
If you get any warnings about the file path or name being too long skip the warnings.
---
3) Update NPM
Now you should be able to run ```npm i -g npm``` to update/reinstall npm without any warnings.
I find this step especially important if you had errors in Windows about the path or file name being too long.
You may get the following errors. If you do go and delete or move the files it has listed and you should be able to run ```npm i -g``` npm successfully.
``` npm ERR! Refusing to delete C:\Program Files\nodejs\npx.cmd: is outside C:\Program Files\nodejs\node_modules\npm and not a link npm ERR! File exists: C:\Program Files\nodejs\npx.cmd npm ERR! Move it away, and try again.
npm ERR! Refusing to delete C:\Program Files\nodejs\npm.cmd: is outside C:\Program Files\nodejs\node_modules\npm and not a link npm ERR! File exists: C:\Program Files\nodejs\npm.cmd npm ERR! Move it away, and try again. ```
## Delete the Global NPM Folder
https://stackoverflow.com/a/5926706/349659
``` npm list -g ```
For Windows this will most likely be:
`%AppData%\npm\node_modules`
You can paste that into a folder's address bar and it will take you there.
Once there delete the folder named `npm`.
## Download the Latest Release of NPM
https://github.com/npm/cli/releases/latest
Grab the zip and unzip it to your `node_modules` folder that you just deleted the npm folder from.
Rename the folder you extracted from the zip to `npm`
If you get any warnings about the file path or name being too long skip the warnings.
## Update for Good Luck
Now you should be able to run `npm i -g npm` to update/reinstall npm without any warnings.
I find this step especially important if you had errors in Windows about the path or file name being too long.
You may get the following errors. If you do go and delete or move the files it has listed and you should be able to run `npm i -g npm` successfully.
npm ERR! Refusing to delete C:\Program Files\nodejs\npx.cmd: is outside C:\Program Files\nodejs\node_modules\npm and not a link npm ERR! File exists: C:\Program Files\nodejs\npx.cmd npm ERR! Move it away, and try again. npm ERR! Refusing to delete C:\Program Files\nodejs\npm.cmd: is outside C:\Program Files\nodejs\node_modules\npm and not a link npm ERR! File exists: C:\Program Files\nodejs\npm.cmd npm ERR! Move it away, and try again.

        
Present in both answers; Present only in the new answer; Present only in the old answer;