2

I would like to add phantomJS library to my angular4 project to continuous integration with jenkins. I tried to dfo it in many ways, but I always get the same (or similar) error.

For example, for this tutorial when I tried install phantomJS and launcher in this way: npm install --save-dev phantomjs-prebuilt karma-phantomjs-launcher i got error:

npm ERR! path C:\Users\jarkro\AppData\Roaming\npm\node_modules\phantomjs-prebuilt\node_modules\sshpk\node_modules\assert-plus\package.json
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\jarkro\AppData\Roaming\npm\node_modules\phantomjs-prebuilt\node_modules\sshpk\node_modules\assert-plus\package.json'
npm ERR!     at Error (native)
npm ERR!  { Error: EPERM: operation not permitted, unlink 'C:\Users\jarkro\AppData\Roaming\npm\node_modules\phantomjs-prebuilt\node_modules\sshpk\node_modules\assert-plus\package.json'
npm ERR!     at Error (native)
npm ERR!   cause:
npm ERR!    { Error: EPERM: operation not permitted, unlink 'C:\Users\jarkro\AppData\Roaming\npm\node_modules\phantomjs-prebuilt\node_modules\sshpk\node_modules\assert-plus\package.json'
npm ERR!        at Error (native)
npm ERR!      errno: -4048,
npm ERR!      code: 'EPERM',
npm ERR!      syscall: 'unlink',
npm ERR!      path: 'C:\\Users\\jarkro\\AppData\\Roaming\\npm\\node_modules\\phantomjs-prebuilt\\node_modules\\sshpk\\node_modules\\assert-plus\\package.json' },
npm ERR!   stack: 'Error: EPERM: operation not permitted, unlink \'C:\\Users\\jarkro\\AppData\\Roaming\\npm\\node_modules\\phantomjs-prebuilt\\node_modules\\sshpk\\node_modules\\assert-plus\\package.json\'\n    at Error (native)',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'C:\\Users\\jarkro\\AppData\\Roaming\\npm\\node_modules\\phantomjs-prebuilt\\node_modules\\sshpk\\node_modules\\assert-plus\\package.json',
npm ERR!   parent: 'phantomjs-prebuilt' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

For clarification: I have administrator praviliage.

Anyone can help me and tell me whats going on?

Jaroslaw K.
  • 5,224
  • 2
  • 39
  • 65
  • All I can tell you is that you don't have admin privilege ... Are you sure you launched your console as admin ? Otherwise, sorry, I can't help you. –  Sep 11 '17 at 07:15
  • Yes, I'm sure. I wrote it for a reason – Jaroslaw K. Sep 11 '17 at 07:25

1 Answers1

0

Ok. I found some solution / walkaround. The help has moved from here and here.

Latest npm version have some bugs with installing libaries, especially in the case when it use fsevent dependency. In my case, I have to downgrade npm to version 5.0.3.

Just use the command:

npm install -g npm@5.0.3
Jaroslaw K.
  • 5,224
  • 2
  • 39
  • 65