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 bower-endpoint-parser#0.2.2
3851 info postinstall bower-logger#0.2.2
3864 info install lru-cache#2.5.0
3865 http 304 https://registry.npmjs.org/lodash.debounce
3868 info postinstall bower-endpoint-parser#0.2.2
3870 info postinstall lru-cache#2.5.0
3872 info preinstall bower-config#0.5.2
3877 info preinstall nopt#3.0.1
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 bower#1.3.7 { [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 <npm-#googlegroups.com>
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! <npm-#googlegroups.com>
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! <npm-#googlegroups.com>
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! <npm-#googlegroups.com>
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! <npm-#googlegroups.com>
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! <npm-#googlegroups.com>
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! <npm-#googlegroups.com>
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! <npm-#googlegroups.com>
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! <npm-#googlegroups.com>
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! <npm-#googlegroups.com>
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! <npm-#googlegroups.com>
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
Windows itself handles directories of arbitrary sizes, but Windows Explorer and high level Windows APIs have a limited directory depth.
Unfortunately the deep module nesting is a result of the combination of node's module loading semantics and npm solving the dependency hell that occurs with other package managers. (Where you want to use two modules with mutually incompatible dependencies.)
The npm bug is here: Provide a way to flatten dependencies to one level to prevent max path issues on windows
You can remove a module all the way down with: npm uninstall <modulename>
Or, if you'd rather remove the directory, get rimraf:
npm install -g rimraf
rimraf <dirname>
Deduping may also put your tree into a more manageable state: npm dedup
I had a very similar issue when attempting to install Bower via NPM. And after reading everyone's suggestion of clean global cache for npm :
npm -g cache clean
It wasn't resolving my problem. What I realized was that there were serious compatibility issues with the version of NPM (1.2.18) and a number of newer packages (dezalgo, q, asap, ...).
Here is the best part is that I thought I was actually updating NPM using the following:
npm install -g npm
...but my console was not displaying errors or warnings, so I assumed everything was updated to the latest. Instead, after realizing that my update to NPM was not activating and I did some digging to find the best way to update your npm:
curl https://www.npmjs.org/install.sh | sh
Winner, winner, chicken dinner! NPM updated to version 2.1.7. After the NPM update, I did not have any issues with:
npm install bower
I think this will work with you guys that are having ENOENT problems with dependencies. Cheers!
The problem only is present on Windows OS. And it only is present if the path are already present (previous installation) and you are updating.
Nodes npm package manager does not install dependencies in one shared vendor folder (like Composer for e.g. does), but always in the vendor folders node_modules sub directory. This leads to an insane path depth like the following (where integers replace the original folder names):
./project/node_modules/1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/
This is not the maximum depth that I've seen so far.
Windows has a maximum path length of 260 characters. It's no problem for Windows to create a path with an insane depth. The problem is deleting from that path. To delete such path, you will have to manually go in and rename the folders bit by bit until you reach a total path length <260 chars. And npm fails alongside Windows when trying to remove that folders before updating (and therefore adding) the new folders.
Edit
As per the comment of #Rarst, there is a solution: Use robocopy. It is very important to follow the below steps as accurate as possible. If you are not doing that, you can erase your harddisk!. There is no guarantee implied and the following is just a documentation of what I did to work around this and no recommendation and no tutorial or otherwise any sort of recommendation by me.
Created an empty directory (named _empty) in the the node_modules folder
Started powershell (worked with cmd as administrator as well)
Entered robocopy _empty dir-to-delete /MIR /s
Done
Remember: You can erase your harddisk when repeating above steps. So if you do that, you do it at your own risk and you should proceed with extreme caution.
I had same errors and npm cache clear/clean didn't solve my issue.
Reinstall from official website instead of aptget solve my issue.
download tar.gz file from https://nodejs.org/
extract with :
tar -zxvf yourtarfile.tar.gz
cd intoyournodefolder
.configure
make
sudo make install
then update npm
sudo npm install npm -g
Related
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/aglio/node_modules/drafter/node_modules/protagonist/drafter/ext/sos/test/ext/Catch/projects/VS2008/TestCatch/TestCatch/TestCatch.vcproj'
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! <npm-#googlegroups.com>
npm ERR! System Linux 3.4.0+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "aglio"
npm ERR! cwd /mnt/c/Users/HEWLETT PACKARD'
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /usr/local/lib/node_modules/aglio/node_modules/drafter/node_modules/protagonist/drafter/ext/sos/test/ext/Catch/projects/VS2008/TestCatch/TestCatch/TestCatch.vcproj
npm ERR! fstream_path /usr/local/lib/node_modules/aglio/node_modules/drafter/node_modules/protagonist/drafter/ext/sos/test/ext/Catch/projects/VS2008/TestCatch/TestCatch/TestCatch.vcproj
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! weird error 1
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /mnt/c/Users/HEWLETT PACKARD'/npm-debug.log
npm ERR! not ok code 0
I am not sure about this problem. I have tried, but it is useless.
If the above error is not readable, you can see the link here.
Reference to agilo.
Resolved:
I used nvm and successfully installed aglio using node v0.12.
Discussed on the issue of github aglio
https://github.com/danielgtaylor/aglio/issues/175
i'm trying to install keystone.js via windows cmd but its still got errors like this:
npm ERR! yo#1.3.3 postinstall: `yodoctor`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the yo#1.3.3 postinstall script.
npm ERR! This is most likely a problem with the yo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! yodoctor
npm ERR! You can get their info via:
npm ERR! npm owner ls yo
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "generator-keystone"
npm ERR! cwd C:\Users\Pisa Family
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! syscall spawn
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! not ok code 0
C:\Users\Pisa Family>npm install -g yo
C:\Users\Pisa Family\AppData\Roaming\npm\yo -> C:\Users\Pisa Family\AppData\Roaming\npm\node_modules\yo\cli.js
i've tried to install yo package too, to try the yo doctor but it ends up failed too. here's the error log:
C:\Users\Pisa Family>npm install -g yo
C:\Users\Pisa Family\AppData\Roaming\npm\yo -> C:\Users\Pisa Family\AppData\Roaming\npm\node_modules\yo\cli.js
> yo#1.3.3 postinstall C:\Users\Pisa Family\AppData\Roaming\npm\node_modules\yo
> yodoctor
npm ERR! yo#1.3.3 postinstall: `yodoctor`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the yo#1.3.3 postinstall script.
npm ERR! This is most likely a problem with the yo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! yodoctor
npm ERR! You can get their info via:
npm ERR! npm owner ls yo
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "yo"
npm ERR! cwd C:\Users\Pisa Family
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! syscall spawn
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! not ok code 0
i already search on google and still couldn't find any solutions (or maybe i missed one). need any advice and help, thx.
try updating npm
npm install -g npm
On my windows8 I tried to install a npm package
npm install grunt-contrib-uglify --save-dev
if I run it without --save-dev it works perfectly
npm install grunt-contrib-uglify --save-dev
adding saving couses an error:
npm ERR! Error: EPERM, open 'C:\2\package.json'
npm ERR! { [Error: EPERM, open 'C:\2\package.json'] errno: 50, code: 'EPERM', path: 'C:\\2\\package.json' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
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" "grunt-contrib-uglify" "--save-dev"
npm ERR! cwd C:\2
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! path C:\2\package.json
npm ERR! code EPERM
npm ERR! errno 50
npm ERR! stack Error: EPERM, open 'C:\2\package.json'
npm ERR! Error: EPERM, open 'C:\2\npm-debug.log'
npm ERR! { [Error: EPERM, open 'C:\2\npm-debug.log'] errno: 50, code: 'EPERM', path: 'C:\\2\\npm-debug.log' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
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" "grunt-contrib-uglify" "--save-dev"
npm ERR! cwd C:\2
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! path C:\2\npm-debug.log
npm ERR! code EPERM
npm ERR! errno 50
npm ERR! stack Error: EPERM, open 'C:\2\npm-debug.log'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\2\npm-debug.log
npm ERR! not ok code 0
I've checked files permissions, I've ran it as Administrator. I cannot find a way to get it working.
Please, help ;)
I had the same issue on OSX, I fixed it executing:
sudo chown -R $USER:$GROUP ~/.npm
and:
npm cache clean
Then I can install the package with --save-dev in the project.
In your case, instead of using chown you can change the permissions on "C:\2" and subfolders to your user using the Windows Explorer, i.e: http://technet.microsoft.com/en-us/magazine/ff404240.aspx Or directly from PowerShell: http://blogs.msdn.com/b/johan/archive/2008/10/01/powershell-editing-permissions-on-a-file-or-folder.aspx
Source: https://github.com/npm/npm/issues/5869
when i run the installation process and put npm install in the command line after running some processes it gives me this :
npm ERR! safefs#3.0.6 preinstall: `node ./cyclic.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the safefs#3.0.6 preinstall script.
npm ERR! This is most likely a problem with the safefs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./cyclic.js
npm ERR! You can get their info via:
npm ERR! npm owner ls safefs
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Users\Class Talkies\Desktop\www\web-starter-kit-master
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! syscall spawn
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! not ok code 0
I also got a few errors upon installing via the npm install command, but in order to get it to go away I relaunched command prompt in administrator mode. It solved the problem easily.
Hope it helps!
Attempting to install Yeoman on my mac, I first tried following command from the documentation...
npm install -g yo
Got an error:
npm ERR! Please try running this command again as root/Administrator.
I tried again with:
sudo npm install -g yo
but it fails half-way through. This is the feedback where it fails and it repeats this pattern for a lot of failed packages.
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/glob/.travis.yml'
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! <npm-#googlegroups.com>
npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "yo"
npm ERR! cwd /Users/vivid
npm ERR! node -v v0.10.7
npm ERR! npm -v 1.2.21
npm ERR! path /usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/glob/.travis.yml
npm ERR! fstream_path /usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/glob/.travis.yml
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
Any thoughts?
I ran into the same problem. What fixed it for me was simply logging in as root first, using:
$ su
Next, installing Yeoman worked like a charm:
$ npm install -g yo
The big difference is the logging in as root using su, instead of sudo.