2

I am trying to install ionic 3 and cordova for the first time in my desktop. I am using windows 7.

npm install -g ionic cordova

shows me this error :

npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
C:\Users\amir\AppData\Roaming\npm\cordova -> C:\Users\amir\AppData\Ro
C:\Users\amir\AppData\Roaming\npm\ionic -> C:\Users\amir\AppData\Roam
npm ERR! path C:\Users\amir\AppData\Roaming\npm\node_modules\ionic\no
.json
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\amir
s\fsevents\node_modules\ansi-regex\package.json'
npm ERR!     at Error (native)
npm ERR!  { Error: EPERM: operation not permitted, unlink 'C:\Users\a
ules\fsevents\node_modules\ansi-regex\package.json'
npm ERR!     at Error (native)
npm ERR!   stack: 'Error: EPERM: operation not permitted, unlink \'C:
\ionic\\node_modules\\fsevents\\node_modules\\ansi-regex\\package.jso
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'C:\\Users\\amir\\AppData\\Roaming\\npm\\node_module
i-regex\\package.json' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

I tried entering windows PowerShell in administrator mode but the problem is not solved. Any idea please ?

Amir Choubani
  • 829
  • 2
  • 14
  • 28

5 Answers5

7

I solved the problem.

It is not about node-uuid.

I just go to appData/Roaming/npm and i deleted

node-module folder

and

npm cache

and then, It worked

Amir Choubani
  • 829
  • 2
  • 14
  • 28
3

The answer is here : https://stackoverflow.com/a/44150369/6291722 node-uuid@1.4.8 is an old module, you need to upgrade it, or upgrade NodeJs itself.

Marouan
  • 217
  • 1
  • 8
0

I had the same problem, fixed it by downgrading npm from 5.4.0 to 5.3.0.

npm install npm@5.3.0
Mark
  • 143
  • 6
0

I had the same problem under different circumstances (I was trying to run npm publish which used to work correctly).

I solved it by upgrading npm with npm install -g npm. This installed npm@6.9.0.

Qwertie
  • 16,354
  • 20
  • 105
  • 148
-1

Running as admin worked for me ! :)