28

I'm encountering the below error stack trace, while I try to install "jQuery" using Bower. Can someone offer some help?

    C:\study\meanApp>bower install jquery --save
    bower not-cached    git://github.com/jquery/jquery.git#*
    bower resolve       git://github.com/jquery/jquery.git#*
    bower download      https://github.com/jquery/jquery/archive/2.1.1.tar.gz
    bower retry         Download of https://github.com/jquery/jquery/archive/2.1.1.t
    ar.gz failed, trying with git..
    bower EPERM         EPERM, unlink 'C:\Users\UserZ\AppData\Local\Temp\AUserZ\bower\jquery-8680-AaJIqU\archive.tar.gz'

    Stack trace:
    Error: EPERM, unlink 'C:\Users\UserZ\AppData\Local\Temp\A-UserZ\bower\jqu
    ery-8680-AaJIqU\archive.tar.gz'

    Console trace:
    Trace
        at StandardRenderer.error (C:\Users\UserZ\AppData\Roaming\npm\node_module
    s\bower\lib\renderers\StandardRenderer.js:72:17)
        at Logger.<anonymous> (C:\Users\UserZ\AppData\Roaming\npm\node_modules\bo
    wer\bin\bower:110:22)
        at Logger.EventEmitter.emit (events.js:95:17)
        at Logger.emit (C:\Users\UserZ\AppData\Roaming\npm\node_modules\bower\nod
    e_modules\bower-logger\lib\Logger.js:29:39)
        at C:\Users\UserZ\AppData\Roaming\npm\node_modules\bower\lib\commands\ind
    ex.js:40:20
        at _rejected (C:\Users\UserZ\AppData\Roaming\npm\node_modules\bower\node_
    modules\q\q.js:797:24)
        at C:\Users\UserZ\AppData\Roaming\npm\node_modules\bower\node_modules\q\q
    .js:823:30
        at Promise.when (C:\Users\UserZ\AppData\Roaming\npm\node_modules\bower\no
    de_modules\q\q.js:1035:31)
        at Promise.promise.promiseDispatch (C:\Users\UserZ\AppData\Roaming\npm\no
    de_modules\bower\node_modules\q\q.js:741:41)
        at C:\Users\UserZ\AppData\Roaming\npm\node_modules\bower\node_modules\q\q
    .js:557:44

    System info:
    Bower version: 1.3.9
    Node version: 0.10.18
    OS: Windows_NT 6.1.7601 ia32

P.S: I've gone through the StackOverflow could find nothing related to my error, hence posting this question.

Thanks in advance, Dave

David R
  • 14,711
  • 7
  • 54
  • 72

9 Answers9

48

Cleaning the cache resolved the error for me: npm cache clean

Markus Pscheidt
  • 6,853
  • 5
  • 55
  • 76
10

I got the same error "EPERM, unlink" but with a different archive.

Running these commands resolved the issue for me:

  • npm uninstall -g bower
  • npm update decompress-zip
  • npm install -g bower

This link is where I saw to use those commands: https://github.com/bower/bower/issues/798 It is the updating of the decompress-zip that has resolved the issue for others as well.

molafson
  • 119
  • 1
  • 4
6

I got this error and ran the bower in verbose mode. And found the error as below:

bower error         SELF_SIGNED_CERT_IN_CHAIN

To resolve this, add below line into .bowerrc created in your default home directory.

"strict-ssl": false

Try bower install again, it should work.

Hardik Patel
  • 61
  • 1
  • 1
3

You could try the following sequence. It worked for me. bower cache clean npm uninstall -g bower npm install -g bower bower install jQuery#2.1.1

Derocs
  • 73
  • 5
2

I had a similar problem and i resolved it pretty easily; I was trying to bower install while running a server from my machine. I disconnected the server and IDE (webstorm) and it worked.

dror
  • 83
  • 7
0

i also got the same problem and i tried again all uninstalled everything then after i install again gitbash command in gitbash

$ npm install -g bower   // let it execute

once executed

again command

$ bower install bootstrap        // let it execute

when executed you got if want more then run more commands :)

e.g.

$ bower install script.js
Hitesh
  • 3,449
  • 8
  • 39
  • 57
Aadil
  • 1
0

Whenever I encounter this error, what I do is to clean the npm's cache,

npm cache clean

and if it doesn't work, I uninstall the concerned bower component, and install it again.

f123
  • 382
  • 2
  • 9
0

Uninstall your old node (it may be < 0.12.0)

And Install node version > v0.12.0 (In my case v0.12.7)

Then

npm update npm -g

And

bower install
Nishchit
  • 18,284
  • 12
  • 54
  • 81
0

I resolved it by running

bower cache clean

Deb
  • 1
  • 2