Macbook cannot install hexo - node.js

Here is the log:
npm ERR! Error: read ETIMEDOUT
npm ERR! at errnoException (net.js:863:11)
npm ERR! at TCP.onread (net.js:524:19)
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 14.1.0
npm ERR! command "/Users/JianqingJiang/~/nvm/v0.10.0/bin/node" "/Users/JianqingJ
npm ERR! cwd /
npm ERR! node -v v0.10.0
npm ERR! npm -v 1.2.14
npm ERR! syscall read
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm http GET https://registry.npmjs.org/abbrev
I install the git and node.js and looks good but when I want to install hexo, the error shows up.

As mentioned in the comments, full command would help. I will assume that you were doing npm install hexo...
What can be deduced here is that npm tried to obtain theabbrev package (the first dependency of hexo, btw) and the HTTP request timed out.
So you should check your network connection etc (proxies ...) and try again. I just installed here without issue.

Related

NPM ERR! When trying to run Meteor project

I'm trying to view someone else's Meteor project from Github. I cloned it then tried running it by typing 'meteor' but what results is this slew of errors. I've included a sample below. I am running the command prompt as administrator. Clearly this has something to do with Node or its packages but I'm at a loss of where I should go with this. If someone could give me a hint I would be grateful.
npm http GET https://registry.npmjs.org/camelcase
npm http GET https://registry.npmjs.org/map-obj
npm http 304 https://registry.npmjs.org/mime-db
npm http GET https://registry.npmjs.org/get-stdin
npm http GET https://registry.npmjs.org/repeating
npm http 304 https://registry.npmjs.org/async
etc. etc....
npm ERR! error rolling back errno: 50,
npm ERR! error rolling back code: 'EPERM',
npm ERR! error rolling back path:
'C:\Users\Kyle\Documents\Websites...
npm ERR! 'Object.oncomplete (fs.js:108:15)' ] }
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:\Users\Kyle\AppData\Local\.meteor\packages\meteor-tool\1.1.10\mt-os.windows.x86_32\dev_bundle\bin\\node.exe"
"C:\Users\Kyle\AppData\Local\.meteor\packages\meteor-tool\1.1.10\mt-
os.windows.x86_32\dev_bundle\bin\node_modules\npm\bin\npm-cli.js"
"install"
npm ERR! cwd
C:\Users\Kyle\Documents\Websites\thisWebsite\packages\npm-container.npm\package-new-14v2dj3
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call chmod
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack
C:\Users\Kyle\AppData\Local.meteor\packages\meteor-tool\1.1.10\mt-os.windows.x86_32\dev_bundle\bin\node_modules\npm\node_modules\fstream\lib\writer.js:305:19
npm ERR! fstream_type Directory npm
ERR! fstream_class DirWriter
npm ERR! code EPERM
npm ERR! errno 50
npm ERR! stack Error:
EPERM, mkdir
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.9
npm ERR! path...
npm ERR! fstream_stack Object.oncomplete (fs.js:108:15)
npm ERR!
Error: version not found: ansi-styles#2.2.0
npm ERR! at
C:\Users\Kyle\AppData\Local.meteor\packages\meteor-tool\1.1.10...
npm ERR! at Object.oncomplete (fs.js:108:15)
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues
npm ERR! System Windows_NT 6.2.9200
npm ERR! command
"C:\Users\Kyle\AppData\Local\.meteor\packages\meteor-tool\1.1.10\mt-os.windows.x86_32\dev_bundle\bin\\node.exe"
Try running the CMD / Powershell with Administrator (Run as Administrator). and then install npm dependencies as Github usually don't store them do: npm install and npm start. If you keep getting the errors. go to C:\Program Files\nodejs\node_modules\
or where your nodejs is installed and do right click, choose 'Properties' and go to 'Security' tab and give privileges to the user you need and try running npm install. Good luck
This worked in my particular case:
Remove meteorhacks and npm-container by typing this in the console:
meteor remove meteorhacks:npm npm-container
Delete the 'npm-container' folder which is generated by the package.
Run 'npm init' to create a package.json
Copy the contents of packages.json to the dependencies section of package.json

Can't Install Mongoose via NPM

I am trying to download mongoose into my node.js project via npm.
The command is npm install mongoose. However, this leads to the below output, and eventually leads to an error. The only things in the mongoose directory are the dependencies (in the node_modules folder). Any other package will work, but mongoose repeatedly fails. I've tried npm install -g mongoose and sudo npm install mongoose, but neither of them work either.
Any ideas what might be going wrong?
node version 0.10.20
npm version 1.3.11
$ npm install mongoose
npm WARN package.json mongo#0.1.0 No repository field.
npm http GET https://registry.npmjs.org/mongoose
npm http 304 https://registry.npmjs.org/mongoose
npm http GET https://registry.npmjs.org/ms/0.1.0
npm http GET https://registry.npmjs.org/sliced/0.0.5
npm http GET https://registry.npmjs.org/hooks/0.2.1
npm http GET https://registry.npmjs.org/muri/0.3.1
npm http GET https://registry.npmjs.org/mongodb/1.3.19
npm http GET https://registry.npmjs.org/regexp-clone/0.0.1
npm http GET https://registry.npmjs.org/mpath/0.1.1
npm http GET https://registry.npmjs.org/mpromise/0.2.1
npm http 304 https://registry.npmjs.org/ms/0.1.0
npm http 304 https://registry.npmjs.org/sliced/0.0.5
npm http 304 https://registry.npmjs.org/hooks/0.2.1
npm http 304 https://registry.npmjs.org/muri/0.3.1
npm http 304 https://registry.npmjs.org/mongodb/1.3.19
npm http 304 https://registry.npmjs.org/regexp-clone/0.0.1
npm http 304 https://registry.npmjs.org/mpath/0.1.1
npm http 304 https://registry.npmjs.org/mpromise/0.2.1
npm ERR! Error: ENOENT, chmod '/Users/khanh/Code/bunnybots/node_modules/mongoose/node_modules/mongodb/index.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 Darwin 11.4.2
npm ERR! command "/Users/khanh/.nvm/v0.10.20/bin/node" "/Users/khanh/.nvm/v0.10.20/bin/npm" "install" "mongoose"
npm ERR! cwd /Users/khanh/Code/bunnybots
npm ERR! node -v v0.10.20
npm ERR! npm -v 1.3.11
npm ERR! path /Users/khanh/Code/bunnybots/node_modules/mongoose/node_modules/mongodb/index.js
npm ERR! fstream_path /Users/khanh/Code/bunnybots/node_modules/mongoose/node_modules/mongodb/index.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call chmod
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /Users/khanh/.nvm/v0.10.20/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/Users/khanh/Code/bunnybots/node_modules/mongoose/node_modules/hooks'
npm ERR! error rolling back mongoose#3.6.20 { [Error: ENOTEMPTY, rmdir '/Users/khanh/Code/bunnybots/node_modules/mongoose/node_modules/hooks']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: '/Users/khanh/Code/bunnybots/node_modules/mongoose/node_modules/hooks' }
npm ERR! Error: ENOENT, open '/Users/khanh/Code/bunnybots/node_modules/mongoose/node_modules/mpath/package.json'
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 11.4.2
npm ERR! command "/Users/khanh/.nvm/v0.10.20/bin/node" "/Users/khanh/.nvm/v0.10.20/bin/npm" "install" "mongoose"
npm ERR! cwd /Users/khanh/Code/bunnybots
npm ERR! node -v v0.10.20
npm ERR! npm -v 1.3.11
npm ERR! path /Users/khanh/Code/bunnybots/node_modules/mongoose/node_modules/mpath/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! Error: ENOENT, open '/Users/khanh/Code/bunnybots/node_modules/mongoose/node_modules/mpromise/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 Darwin 11.4.2
npm ERR! command "/Users/khanh/.nvm/v0.10.20/bin/node" "/Users/khanh/.nvm/v0.10.20/bin/npm" "install" "mongoose"
npm ERR! cwd /Users/khanh/Code/bunnybots
npm ERR! node -v v0.10.20
npm ERR! npm -v 1.3.11
npm ERR! path /Users/khanh/Code/bunnybots/node_modules/mongoose/node_modules/mpromise/README.md
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/khanh/Code/bunnybots/npm-debug.log
npm ERR! not ok code 0
Use npm cache clean.
After that, install as normal, and the download should proceed correctly.
stop node server if its running, that was the problem in my case
I faced the same issue. Try this:
npm install -s mongoose
This will install it on your app, in fact on your package.json. It will be available as dependencies so you can easily require it.
Otherwise try
sudo npm install -g mongoose
That should also work, from your output above I can see that you haven't tried that.
Make index.js file in the folder where you have made the empty file of node using the command
npm init
Now try to install mongoose using command
npm install mongoose
If this doesn't work
delete the folder in which you have made empty node project.
then again make the same folder and then use the above instruction.
"npm cache clean --force ->> npm i mongoose" Worked for me.
It was just a problem with my local machine's NPM so make sure to restart your machine. It worked for me. 1

Node.js: npm doesn't install anymore

I don't know what I did wrong, but trying to install a module using npm returns errors. My concrete example (same results, no matter which module I would like to install):
npm install socket.io
Returns:
npm ERR! TypeError: Cannot call method 'replace' of undefined
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:332:45
npm ERR! at fs.js:117:20
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:53:5
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:62:5
npm ERR! at Object.oncomplete (fs.js:297: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 Darwin 11.4.2
npm ERR! command "node" "/usr/local/bin/npm" "install" "socket.io"
npm ERR! cwd /Users/Hassen/www/node/btask
npm ERR! node -v v0.8.16
npm ERR! npm -v 1.1.69
npm ERR! type non_object_property_call
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/Hassen/www/node/btask/npm-debug.log
npm ERR! not ok code 0
Any idea? Thanks in advance :)
This error is usually caused by a .git directory in current directory on which no commit has been made.
Either remove the directory or make at least one commit before trying npm again.
EDIT: From this npm issue page;
This issue has been fixed in the latest release. Please update to the latest node and npm (v0.8.17 and v1.2.0, respectively)

Node.js npm install module error

Here is my node and npm version:
node -v v0.4.11
npm -v 1.0.27
When I tried to install a module for example express, I get the following error:
[root#localhost npm]# npm install express
npm ERR! Error: First argument needs to be a number, array or string.
npm ERR! at new Buffer (buffer.js:156:15)
npm ERR! at regRequest (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:82:17)
npm ERR! at GET (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:211:3)
npm ERR! at get_ (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:121:3)
npm ERR! at /usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:46:10
npm ERR! at cb (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:37:9)
npm ERR! Report this *entire* log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR!
npm ERR! System Linux 2.6.40.3-0.fc15.i686.PAE
npm ERR! command "node" "/usr/local/bin/npm" "install" "express"
npm ERR! cwd /home/kelvin/Downloads/npm
npm ERR! node -v v0.4.11
npm ERR! npm -v 1.0.27
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/kelvin/Downloads/npm/npm-debug.log
npm not ok
Looks like your auth is set to something that doesn't work. Not clear how that happened -- perhaps check your /home/kelvin/.npmrc for a stray config? Shooting in the dark a bit. I would try npm mailing list if you don't find something in the rc.
https://github.com/isaacs/npm/issues/1372#issuecomment-2036919
isaacs: "The master branch from git is often unstable. This is fixed in HEAD already."
Solved after git pull, and make install.

NPM Erroring While Trying to Install Socket.IO

So I'm trying to install socket.io on my machine, and I'm coming across this little gem:
[ME ~]$ sudo npm install socket.io
npm ERR! Error: ENOTFOUND, Domain name not found
npm ERR! at IOWatcher.callback (dns.js:74:15)
npm ERR! Report this *entire* log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR!
npm ERR! System Linux 2.6.35.13-92.fc14.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "socket.io"
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ME/npm-debug.log
npm not ok
[ME ~]$
I can't tell if it has to do with my firewall, my npm that I have installed, or some other such issue...has anyone encountered a similar issue?

Resources