I am on Windows 8, running command prompt as administrator. I run this command:
npm install -g bower
This gives me errors. I can't provide the full output to npm-debug.log since I am limited to 30000 characters. StackOverflow complains about the length of my post and that it appears to contain code that is not properly formatted as code even though I put it in a pre
, so I removed all lines with " silly " or " verbose ", and I also cut away everything except the end, which is where the interesting bits appear to be.
npm-debug.log contains the following:
3850 info install [email protected]
3851 info postinstall [email protected]
3864 info install [email protected]
3865 http 304 https://registry.npmjs.org/lodash.debounce
3868 info postinstall [email protected]
3870 info postinstall [email protected]
3872 info preinstall [email protected]
3877 info preinstall [email protected]
3878 error error rolling back Error: ENOTEMPTY, rmdir 'C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\q'
3878 error error rolling back [email protected] { [Error: ENOTEMPTY, rmdir 'C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\q']
3878 error error rolling back errno: 53,
3878 error error rolling back code: 'ENOTEMPTY',
3878 error error rolling back path: 'C:\\Users\\Mikal\\AppData\\Roaming\\npm\\node_modules\\bower\\node_modules\\q' }
3879 error Error: No compatible version found: chalk@'^0.4.0'
3879 error Valid install targets:
3879 error ["0.1.0","0.1.1","0.2.0","0.2.1","0.3.0","0.4.0","0.5.0"]
3879 error at installTargetsError (C:\Program Files\nodejs\node_modules\npm\lib\cache.js:719:10)
3879 error at C:\Program Files\nodejs\node_modules\npm\lib\cache.js:641:10
3879 error at RegClient.get_ (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\get.js:101:14)
3879 error at RegClient.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\get.js:37:12)
3879 error at fs.js:266:14
3879 error at Object.oncomplete (fs.js:107:15)
3880 error If you need help, you may report this log at:
3880 error <http://github.com/isaacs/npm/issues>
3880 error or email it to:
3880 error <[email protected]>
3881 error System Windows_NT 6.2.9200
3882 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "bower"
3883 error cwd C:\nodeapps
3884 error node -v v0.10.11
3885 error npm -v 1.2.30
From what I can understand there's an error because the C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\q
directory is not empty and thus cannot be removed. However, when I navigate there in Windows Explorer, there is no q
directory inside of \nodemodules\
.
If I go to my command prompt and scroll as far up as I'm able to go, I find the following:
ream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http GET https://registry.npmjs.org/optimist
npm ERR! Error: ENOENT, lstat 'C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\chalk\node_modules\strip-ansi\readme.md'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "bower"
npm ERR! cwd C:\nodeapps
npm ERR! node -v v0.10.11
npm ERR! npm -v 1.2.30
npm ERR! path C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\chalk\node_modules\strip-ansi\readme.md
npm ERR! fstream_path C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\chalk\node_modules\strip-ansi\readme.md
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat 'C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\decompress-zip\lib\structures.js'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "bower"
npm ERR! cwd C:\nodeapps
npm ERR! node -v v0.10.11
npm ERR! npm -v 1.2.30
npm ERR! path C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\decompress-zip\lib\structures.js
npm ERR! fstream_path C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\decompress-zip\lib\structures.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat 'C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\inquirer\lib\prompts\input.js'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "bower"
npm ERR! cwd C:\nodeapps
npm ERR! node -v v0.10.11
npm ERR! npm -v 1.2.30
npm ERR! path C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\inquirer\lib\prompts\input.js
npm ERR! fstream_path C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\inquirer\lib\prompts\input.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat 'C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\fstream\lib\file-reader.js'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "bower"
npm ERR! cwd C:\nodeapps
npm ERR! node -v v0.10.11
npm ERR! npm -v 1.2.30
npm ERR! path C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\fstream\lib\file-reader.js
npm ERR! fstream_path C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\fstream\lib\file-reader.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http GET https://registry.npmjs.org/osenv/0.0.3
npm ERR! Error: ENOENT, lstat 'C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\semver\semver.js'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "bower"
npm ERR! cwd C:\nodeapps
npm ERR! node -v v0.10.11
npm ERR! npm -v 1.2.30
npm ERR! path C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\semver\semver.js
npm ERR! fstream_path C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\semver\semver.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http 304 https://registry.npmjs.org/osenv/0.0.3
npm http 200 https://registry.npmjs.org/optimist
npm ERR! Error: ENOENT, lstat 'C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\q\q.js'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "bower"
npm ERR! cwd C:\nodeapps
npm ERR! node -v v0.10.11
npm ERR! npm -v 1.2.30
npm ERR! path C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\q\q.js
npm ERR! fstream_path C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\q\q.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat 'C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\request\request.js'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "bower"
npm ERR! cwd C:\nodeapps
npm ERR! node -v v0.10.11
npm ERR! npm -v 1.2.30
npm ERR! path C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\request\request.js
npm ERR! fstream_path C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\request\request.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat 'C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\handlebars\dist\handlebars.amd.js'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "bower"
npm ERR! cwd C:\nodeapps
npm ERR! node -v v0.10.11
npm ERR! npm -v 1.2.30
npm ERR! path C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\handlebars\dist\handlebars.amd.js
npm ERR! fstream_path C:\Users\Mikal\AppData\Roaming\npm\node_modules\bower\node_modules\handlebars\dist\handlebars.amd.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
Edit:
Starting to take matters into my own hands, I noticed that the folders mentioned in the ENOENT, lstat
lines were missing. So I attempted to install them. Chalk would not install:
C:\nodeapps>npm install -g chalk
npm http GET https://registry.npmjs.org/chalk
npm http 200 https://registry.npmjs.org/chalk
npm http GET https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz
npm http 200 https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz
npm http GET https://registry.npmjs.org/escape-string-regexp
npm http GET https://registry.npmjs.org/has-ansi
npm http GET https://registry.npmjs.org/supports-color
npm http GET https://registry.npmjs.org/ansi-styles
npm http GET https://registry.npmjs.org/strip-ansi
npm http 200 https://registry.npmjs.org/ansi-styles
npm http 200 https://registry.npmjs.org/strip-ansi
npm ERR! Error: No compatible version found: strip-ansi@'^0.3.0'
npm ERR! Valid install targets:
npm ERR! ["0.1.0","0.1.1","0.2.0","0.2.1","0.2.2","0.3.0"]
npm ERR! at installTargetsError (C:\Program Files\nodejs\node_modules\npm\lib\cache.js:719:10)
npm ERR! at C:\Program Files\nodejs\node_modules\npm\lib\cache.js:641:10
npm ERR! at saved (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\get.js:138:7)
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "chalk"
npm ERR! cwd C:\nodeapps
npm ERR! node -v v0.10.11
npm ERR! npm -v 1.2.30
npm http 200 https://registry.npmjs.org/escape-string-regexp
npm http 200 https://registry.npmjs.org/has-ansi
npm http 200 https://registry.npmjs.org/supports-color
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\nodeapps\npm-debug.log
npm ERR! not ok code 0
Decompress-zip
, Inquirer
, fstream
, semver
, request
and handlebars
would install, with some warnings.
Retrying chalk
after installing these did not work. From the "valid install targets" error line and some comments on a similar issue on Github with Macports, I got the idea that I should roll back npm to version 0.3.0.
Couldn't figure out how to do it. https://github.com/npm/npm/issues/5470 recommended npm cache clean
, so I did that, followed by trying to install chalk again, which this time gave me
npm ERR! Error: No compatible version found: ansi-styles@'^1.1.0'
npm ERR! Valid install targets:
npm ERR! ["0.1.0","0.1.1","0.1.2","0.2.0","1.0.0","1.1.0"]
npm ERR! at installTargetsError (C:\Program Files\nodejs\node_modules\npm\lib\cache.js:719:10)
npm ERR! at C:\Program Files\nodejs\node_modules\npm\lib\cache.js:641:10
npm ERR! at saved (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\get.js:138:7)
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "chalk"
npm ERR! cwd C:\nodeapps
npm ERR! node -v v0.10.11
npm ERR! npm -v 1.2.30
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\nodeapps\npm-debug.log
npm ERR! not ok code 0
This indicates to me that I should roll back to version "1.1.0" - unfortunately I don't know how to do this.
On the previously linked GitHub issue, the person only managed to get it working by reinstalling node.js. So unless someone comes up with another solution soon, I think that's what I'll do.
I just went through the same issues attempting to install bower on my Windows 7 machine. I can vouch that reinstalling node.js fixed the problem!
I had similar problems on Windows 7 and got fixed running:
npm rm -g bower
npm cache clean
npm i -g bower
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With