Failed to upgrade
carpben opened this issue · 6 comments
I followed the instructions. Openning Powershell as admin:
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
npm install --global --production npm-windows-upgrade
npm-windows-upgrade
I get the following message:
npm-windows-upgrade : The term 'npm-windows-upgrade' is not recognized as the name of a cmdlet, function, script file,
or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:1 char:1
+ npm-windows-upgrade ....
This persisted after restarting the computer. Windows 10 version 1803, Node v 8.11.3, npm v 5.6.0
It looks like the folder npm
's installs global stuff to is not on your path
environmental variable(see npm-folders) . From powershell, if you run: dir $(npm -g bin)
what is the output?
Mine is:
Directory: F:\oo\bar\nvm\current\nodejs\nodejs
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 10/17/2018 4:51 PM etc
d----- 10/17/2018 4:53 PM node_modules
-a---- 10/17/2018 4:50 PM 22963864 node.exe
-a---- 10/17/2018 4:50 PM 833 npm
-a---- 10/17/2018 4:52 PM 383 npm-windows-upgrade
-a---- 10/17/2018 4:52 PM 260 npm-windows-upgrade.cmd
-a---- 10/17/2018 4:50 PM 483 npm.cmd
-a---- 10/17/2018 4:50 PM 833 npx
-a---- 10/17/2018 4:50 PM 483 npx.cmd
then if I echo $env:Path
, F:\oo\bar\nvm\current\nodejs\nodejs
is on there. npm-windows-upgrade
will be available to me to run in the current shell.
@virtuoushub, Sorry about the delay, and thanks for your reply!
I found a different solution to upgrade NPM.
In case it's still relevant, here is the result of running dir $(npm -g bin)
:
Directory: C:\Users\carpb\AppData\Roaming\npm
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 7/26/2018 11:05 AM etc
d----- 10/17/2018 2:15 PM node_modules
-a---- 10/17/2018 2:15 PM 341 create-react-app
-a---- 10/17/2018 2:15 PM 218 create-react-app.cmd
-a---- 7/31/2018 1:58 PM 345 firebase
-a---- 7/31/2018 1:58 PM 222 firebase.cmd
-a---- 9/24/2018 7:01 PM 383 npm-windows-upgrade
-a---- 9/24/2018 7:01 PM 260 npm-windows-upgrade.cmd
-a---- 7/29/2018 6:02 PM 327 serve
-a---- 7/29/2018 6:02 PM 204 serve.cmd
When I run echo $env:Path
I do find C:\Program Files\nodejs\;