Problem upgrading from Ionic CLI 3.4.0 to 3.9.2

Hi.

I have some problems upgrading from Ionic version 3.4.0 to 3.9.2. When running the command npm install -g ionic@latest, I get the following errors:

Exception: C:\Users\AppData\Roaming\npm
`-- ionic@3.9.2

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\ionic\node_modules\chokidar\node_modules\f
sevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {“os”:“darwin”,“arch”:"any
"} (current: {“os”:“win32”,“arch”:“x64”})
npm ERR! Windows_NT 10.0.15063
npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “ins
tall” “-g” “ionic@latest”
npm ERR! node v6.11.2
npm ERR! npm v3.10.10
npm ERR! path C:\Users\AppData\Roaming\npm\node_modules.staging
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall mkdir

npm ERR! Error: EPERM: operation not permitted, mkdir ‘C:\Users\AppData\Roaming\npm\node_modules.staging’
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, mkdir ‘C:\Users\AppData\Roaming\npm\node_modules.staging’
npm ERR! at Error (native)
npm ERR! errno: -4048,
npm ERR! code: ‘EPERM’,
npm ERR! syscall: ‘mkdir’,
npm ERR! path: ‘C:\Users\AppData\Roaming\npm\node_modules\.staging’ }
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\Eier\npm-debug.log

I’ve tried figureing out the solution to the problem, without success.

If anyone wants me to include any additional information, please let me know.

Might be an obvious question, but have you tried with Administrator user?

If you use Windows, try looking for cmd at the start menu, and before clic/enter, do right-click and then Run as Administrator. Once done, try again.

Yes. I’ve tried updating through cmd as administrator, but it still doesn’t update properly.

problem

Don’t do this. If the install goes wrong, it can be a real headache to fix. Too late for you now, I know. But for the future, you don’t need (or want) Admin powers for this.

To your question: are you in Windows?

1 Like

Don’t do this. If the install goes wrong, it can be a real headache to fix. Too late for you now, I know. But for the future, you don’t need (or want) Admin powers for this.

Thanks for the information. I’ll keep it in mind.

I’m using Windows, yes.

Might it be that ionic is installed as standalone in your proyect, so when you run ionic -v you are looking at the proyect version instead of the global one? If so, you can try just npm update inside your proyects directory.

Install nvm-for-windows. Use that to install a clean version of Node. It can be the most recent version of 6, 7, or 8, whichever track you prefer. But be sure to update because Node reported a major security risk a few weeks ago, which is now patched. Install ionic into the clean Node install. Then port your project into that. Be sure to read the ionic changelog, because you’re going to have to deal with the “vendor.js” breaking change. (It’s an easy fix, but you have to know that you need to do it.) Then you should be ok.

3 Likes

Might it be that ionic is installed as standalone in your proyect, so when you run ionic -v you are looking at the proyect version instead of the global one? If so, you can try just npm update inside your proyects directory.

Thanks for your answer. Unfortunately, that doesn’t seem to be the problem either.

Thank you. I will check it out.