When I try to run $ npm install to install all modules on project, or when trying to install ember v 2.18 with $ npm install ember#2.18 it gives me the error:
npm http GET https://www.npmjs.com/ember
npm http 200 https://www.npmjs.com/ember
npm ERR! registry error parsing json
npm ERR! SyntaxError: Unexpected token <
npm ERR!
npm ERR! <!doctype html>
npm ERR! <html>
. . .
. . .
npm ERR! </html>
npm ERR!
npm ERR! at Object.parse (native)
npm ERR! at RegClient.<anonymous> (/home/felipe/.nvm/v0.8.16/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:226:23)
npm ERR! at Request.init.self.callback (/home/felipe/.nvm/v0.8.16/lib/node_modules/npm/node_modules/request/main.js:120:22)
npm ERR! at Request.EventEmitter.emit (events.js:99:17)
npm ERR! at Request.<anonymous> (/home/felipe/.nvm/v0.8.16/lib/node_modules/npm/node_modules/request/main.js:648:16)
npm ERR! at Request.EventEmitter.emit (events.js:126:20)
npm ERR! at IncomingMessage.Request.start.self.req.self.httpModule.request.buffer (/home/felipe/.nvm/v0.8.16/lib/node_modules/npm/node_modules/request/main.js:610:14)
npm ERR! at IncomingMessage.EventEmitter.emit (events.js:126:20)
npm ERR! at IncomingMessage._emitEnd (http.js:366:10)
npm ERR! at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)
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 4.9.0-8-amd64
npm ERR! command "/home/felipe/.nvm/v0.8.16/bin/node" "/home/felipe/.nvm/v0.8.16/bin/npm" "install" "ember#2.18"
npm ERR! cwd /workspace/.../projects/...
npm ERR! node -v v0.8.16
npm ERR! npm -v 1.1.69
npm ERR! type unexpected_token
npm ERR! Error: EACCES, open 'npm-debug.log'
npm ERR! { [Error: EACCES, open 'npm-debug.log'] errno: 3, code: 'EACCES', path: 'npm-debug.log' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 4.9.0-8-amd64
npm ERR! command "/home/felipe/.nvm/v0.8.16/bin/node" "/home/felipe/.nvm/v0.8.16/bin/npm" "install" "ember#2.18"
npm ERR! cwd /workspace/.../projects/...
npm ERR! node -v v0.8.16
npm ERR! npm -v 1.1.69
npm ERR! path npm-debug.log
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open 'npm-debug.log'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /workspace/.../projects/.../npm-debug.log
npm ERR! not ok code 0
I tried with sudo, no luck.
I also tried to uninstall NPM and NodeJS, but no luck also.
How do I fix that? Is this a problem with my NPM or NodeJS installation?
The default npm registry can be found at;
https://registry.npmjs.org/
However, (according to your error log), yours appears to be currently set to:
https://www.npmjs.com/
Try running the following npm-config command to set the registry:
$ npm config set registry https://registry.npmjs.org/
Related
I want to install less module on Centos 6.6 by npm, but I come across some problems.
executed command:
[dinghao#localhost ~]$ sudo npm install -g less
error log:
npm http GET https://registry.npm.taobao.org/less
npm http GET https://registry.npm.taobao.org/less
npm http GET https://registry.npm.taobao.org/less
npm ERR! Error: failed to fetch from registry: less
npm ERR! at RegClient.<anonymous> (/usr/lib/node_modules/npm-registry-client/lib/get.js:140:18)
npm ERR! at cb (/usr/lib/node_modules/npm-registry-client/lib/request.js:32:9)
npm ERR! at RegClient.<anonymous> (/usr/lib/node_modules/npm-registry-client/lib/request.js:122:10)
npm ERR! at cb (/usr/lib/node_modules/npm-registry-client/lib/request.js:132:9)
npm ERR! at RegClient.<anonymous> (/usr/lib/node_modules/npm-registry-client/lib/request.js:225:20)
npm ERR! at Request._callback (/usr/lib/node_modules/npm-registry-client/lib/request.js:204:20)
npm ERR! at self.callback (/usr/lib/node_modules/request/index.js:148:22)
npm ERR! at Request.emit (events.js:117:20)
npm ERR! at ClientRequest.self.clientErrorHandler (/usr/lib/node_modules/request/index.js:257:10)
npm ERR! at ClientRequest.emit (events.js:95:17)
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 2.6.32-504.el6.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "less"
npm ERR! cwd /home/dinghao
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.3.6
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/dinghao/npm-debug.log
npm ERR! not ok code 0
How to resolve this?
Am trying to install appium in ubuntu and got the below error.I searched so many articles and installed node through linuxbrew and even changed the permission also but still getting the below error.Can any one help please
npm ERR! tar.unpack untar error /home/ubuntu/.npm/appium/1.3.6/package.tgz
npm ERR! Linux 3.13.0-44-generic
npm ERR! argv "node" "/home/ubuntu/.linuxbrew/bin/npm" "install" "-g" "appium"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! path /home/ubuntu/lib/node_modules/appium
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! Error: EACCES, mkdir '/home/ubuntu/lib/node_modules/appium'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, mkdir '/home/ubuntu/lib/node_modules/appium']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/home/ubuntu/lib/node_modules/appium',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/home/ubuntu/lib/node_modules/appium',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/home/ubuntu/.linuxbrew/lib/node_modules/npm/node_modules
/fstream/lib/dir-writer.js:36:23',
npm ERR! '/home/ubuntu/.linuxbrew/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53',
npm ERR! 'FSReqWrap.oncomplete (fs.js:99:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /home/ubuntu/npm-debug.log
I have tried npm cache clean also but still not working.
What does linuxbrew doctor return?
Try to bash reset.sh --hardcore to completely reset Appium server and all npm modules
I read many posts here teaching how to update nodejs by using npm. I followed all the proposed steps by I keep getting the same error:
administrator#Ubuntu-CPDiX-Test-Machine:~$ npm install -g npm
npm http GET https://registry.npmjs.org/npm
npm ERR! Error: failed to fetch from registry: npm
npm ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR! at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR! at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR! at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR! at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58)
npm ERR! at Request.emit (events.js:88:20)
npm ERR! at ClientRequest.<anonymous> (/usr/lib/nodejs/request/main.js:412:12)
npm ERR! at ClientRequest.emit (events.js:67:17)
npm ERR! at HTTPParser.onIncoming (http.js:1261:11)
npm ERR! at HTTPParser.onHeadersComplete (http.js:102:31)
npm ERR! You may report this log at:
npm ERR! <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR! reportbug --attach /home/administrator/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.13.0-32-generic
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "npm"
npm ERR! cwd /home/administrator
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: npm
npm ERR! Error: EACCES, permission denied 'npm-debug.log'
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR!
npm ERR! System Linux 3.13.0-32-generic
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "npm"
npm ERR! cwd /home/administrator
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! path npm-debug.log
npm ERR! code EACCES
npm ERR! message EACCES, permission denied 'npm-debug.log'
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/administrator/npm-debug.log
npm not ok
I get this error when I work in a virtual machine: a VMWare Ubuntu 12.04.5. Would you have any suggestions?
Thanks in advance!
Read the error:
Please try running this command again as root/Administrator
Try:
sudo npm install -g npm
And as #mscdex said, you have to upgrade you node version. it is really old.
I am having a problem running npm install zerorpc without sudo access.
a dependency install attempt yum install libpq-dev
does
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
for the npm install attempt I get the error
-- any ideas on how to install zerorpc with out sudo access?
npm http GET https://registry.npmjs.org/zerorpc
npm http 304 https://registry.npmjs.org/zerorpc
npm ERR! Error: EACCES, mkdir '/var/lib/openshift/53475f0f50044611030002fb/node_modules'
npm ERR! { [Error: EACCES, mkdir '/var/lib/openshift/53475f0f50044611030002fb/node_modules']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/var/lib/openshift/53475f0f50044611030002fb/node_modules',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/var/lib/openshift/53475f0f50044611030002fb/node_modules/zerorpc',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/opt/rh/nodejs010/root/usr/lib/node_modules/fstream/lib/writer.js:171:23',
npm ERR! '/opt/rh/nodejs010/root/usr/lib/node_modules/mkdirp/index.js:37:53',
npm ERR! 'Object.oncomplete (fs.js:107:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 2.6.32-431.11.2.el6.bz844450.x86_64
npm ERR! command "node" "/opt/rh/nodejs010/root/usr/bin/npm" "install" "zerorpc"
npm ERR! cwd /var/lib/openshift/53475f0f50044611030002fb
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.17
npm ERR! path /var/lib/openshift/53475f0f50044611030002fb/node_modules
npm ERR! fstream_path /var/lib/openshift/53475f0f50044611030002fb/node_modules/zerorpc
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/var/lib/openshift/53475f0f50044611030002fb/node_modules'
npm ERR! fstream_stack /opt/rh/nodejs010/root/usr/lib/node_modules/fstream/lib/writer.js:171:23
npm ERR! fstream_stack /opt/rh/nodejs010/root/usr/lib/node_modules/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: EACCES, open 'npm-debug.log'
npm ERR! { [Error: EACCES, open 'npm-debug.log'] errno: 3, code: 'EACCES', path: 'npm-debug.log' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 2.6.32-431.11.2.el6.bz844450.x86_64
npm ERR! command "node" "/opt/rh/nodejs010/root/usr/bin/npm" "install" "zerorpc"
npm ERR! cwd /var/lib/openshift/53475f0f50044611030002fb
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.17
npm ERR! path npm-debug.log
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open 'npm-debug.log'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /var/lib/openshift/53475f0f50044611030002fb/npm-debug.log
npm ERR! not ok code 0
I have seen some tips on the internet on how to create the full directory structure for a node project with a command line with expressJS.
Here are some examples:
express express-skeleton << http://quickleft.com/blog/getting-started-with-express-in-node
./node_modules/.bin/express -t ejs << http://naholyr.fr/2011/08/ecrire-service-rest-nodejs-express-partie-1/
--l << http://www.techrepublic.com/article/build-nodejs-web-applications-with-express/
But none of those work for me. I have install express and update it to have it globally installed with npm update express -g but my terminal doesn't even recognize the command line express.
How can I build a web app skeleton easily with the command line? Thanks a lot
EDIT: when running the npm install -g express command line, I get this error message:
npm http GET https://registry.npmjs.org/express
npm http 200 https://registry.npmjs.org/express
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/express'
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/express']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/express',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/express',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',
npm ERR! 'Object.oncomplete (fs.js:107:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "express"
npm ERR! cwd /Users/arnauddrizard/Documents/Dev/RestAPI
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! path /usr/local/lib/node_modules/express
npm ERR! fstream_path /usr/local/lib/node_modules/express
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/local/lib/node_modules/express'
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/arnauddrizard/Documents/Dev/RestAPI/npm-debug.log
npm ERR! not ok code 0
npm unable to create folder inside your application folder.
Give sufficient permissons to your folder, I hope that will fix your issue.
What output do you get when you run npm install -g express? The problem is most likely that npm install -g is not installing to somewhere that's in your PATH.