Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use node package manager on windows #73

Open
thynquest opened this issue Apr 18, 2013 · 5 comments
Open

Unable to use node package manager on windows #73

thynquest opened this issue Apr 18, 2013 · 5 comments

Comments

@thynquest
Copy link

Hello there,

I'm trying to use node-xmpp-bosh in order to set up a bosh connector. I've already intalled node.js which come with npm. however, when I execute the command "npm install node-xmpp-bosh" I have the following error .

npm ERR! registry error parsing json
npm ERR! SyntaxError: Unexpected token A
npm ERR! RESTRICTED ACCESS
npm ERR! at Object.parse (native)
npm ERR! at RegClient. (E:\nodeJs\node_modules\npm\node_modules\npm-registry-client\lib\request.js:235:23
)
npm ERR! at Request.self.callback (E:\nodeJs\node_modules\npm\node_modules\request\index.js:142:22)
npm ERR! at Request.EventEmitter.emit (events.js:98:17)
npm ERR! at Request. (E:\nodeJs\node_modules\npm\node_modules\request\index.js:856:14)
npm ERR! at Request.EventEmitter.emit (events.js:117:20)
npm ERR! at IncomingMessage. (E:\nodeJs\node_modules\npm\node_modules\request\index.js:808:12)
npm ERR! at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR! at _stream_readable.js:883:14
npm ERR! at process._tickCallback (node.js:415:13)
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.0.6002
npm ERR! command "E:\nodeJs\node.exe" "E:\nodeJs\node_modules\npm\bin\npm-cli.js" "install" "node-xmpp-bosh"
npm ERR! cwd E:\nodeJs
npm ERR! node -v v0.10.4
npm ERR! npm -v TypeError: Cannot read property 'node' of undefined
npm ERR! npm -v at E:\nodeJs\node_modules\npm\lib\npm.js:60:38
npm ERR! npm -v at Object. (E:\nodeJs\node_modules\npm\lib\npm.js:511:3)
npm ERR! npm -v at Module._compile (module.js:456:26)
npm ERR! npm -v at Object.Module._extensions..js (module.js:474:10)
npm ERR! npm -v at Module.load (module.js:356:32)
npm ERR! npm -v at Function.Module._load (module.js:312:12)
npm ERR! npm -v at Module.require (module.js:364:17)
npm ERR! npm -v at require (module.js:380:17)
npm ERR! npm -v at E:\nodeJs\node_modules\npm\bin\npm-cli.js:24:11
npm ERR! npm -v at Object. (E:\nodeJs\node_modules\npm\bin\npm-cli.js:86:3)
npm ERR! npm -v [TypeError: Cannot read property 'node' of undefined]
npm ERR! type unexpected_token
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! E:\nodeJs\npm-debug.log
npm ERR! not ok code 0

Then I thought may be it is the json data which is wrong; so I copied the resulted json format and validated with "http://jsonlint.com/" .. no error was detected.

then I created a package.json file, pasted the json in it, and launched the command "npm install" at the folder where I created the package.json file .. that didn't work either and this is what I have.

npm ERR! install Couldn't read dependencies
npm ERR! Error: ENOENT, open 'E:\nodeJs\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! [email protected]

npm ERR! System Windows_NT 6.0.6002
npm ERR! command "E:\nodeJs\node.exe" "E:\nodeJs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! cwd E:\nodeJs
npm ERR! node -v v0.10.4
npm ERR! npm -v TypeError: Cannot read property 'node' of undefined
npm ERR! npm -v at E:\nodeJs\node_modules\npm\lib\npm.js:60:38
npm ERR! npm -v at Object. (E:\nodeJs\node_modules\npm\lib\npm.js:511:3)
npm ERR! npm -v at Module._compile (module.js:456:26)
npm ERR! npm -v at Object.Module._extensions..js (module.js:474:10)
npm ERR! npm -v at Module.load (module.js:356:32)
npm ERR! npm -v at Function.Module._load (module.js:312:12)
npm ERR! npm -v at Module.require (module.js:364:17)
npm ERR! npm -v at require (module.js:380:17)
npm ERR! npm -v at E:\nodeJs\node_modules\npm\bin\npm-cli.js:24:11
npm ERR! npm -v at Object. (E:\nodeJs\node_modules\npm\bin\npm-cli.js:86:3)
npm ERR! npm -v [TypeError: Cannot read property 'node' of undefined]
npm ERR! path E:\nodeJs\package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! E:\nodeJs\npm-debug.log
npm ERR! not ok code 0

I don't know what I did wrong .. so any help would be appreciated

Thank you

@dhruvbird
Copy link
Collaborator

Please could you post the contents of the file E:\nodeJs\npm-debug.log
here?

@dhruvbird
Copy link
Collaborator

This also might be a good idea:

npm ERR! install Couldn't read dependencies
npm ERR! Error: ENOENT, open 'E:\nodeJs\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! [email protected]

@thynquest
Copy link
Author

Ok I've found the solution .. actually when I've set the proxy variable in the .npmrc file with registry = "http://registry.npmjs.org/" instead of "registry = https://registry.npmjs.org/" .. and added the "proxy" variable with the following "http://domain\login:password@proxy_IP:port/" .. but now I'm facing another problem .. when I launch the "npm install node-xmpp-bosh" command all the packages seems to be downloaded well .. but I get the following error : "Failed at the [email protected] install script.This is most likely a problem with the node-expat package," .. so I would like to know if there is a way to get around it by getting an older package or something ?

Thank you for your help

@thynquest
Copy link
Author

this is the entire error

gyp ERR! configure error
gyp ERR! stack Error: spawn ENOENT
gyp ERR! stack at errnoException (child_process.js:975:11)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:766:34)
gyp ERR! System Windows_NT 6.0.6002
gyp ERR! command "node" "E:\nodeJs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd E:\nodeJs\node_modules\node-xmpp-bosh\node_modules\node-expat
gyp ERR! node -v v0.10.4
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! cmd "/c" "node-gyp rebuild" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the node-expat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-expat
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.0.6002
npm ERR! command "E:\nodeJs\node.exe" "E:\nodeJs\node_modules\npm\bin\npm-cli.js" "install" "node-x
mpp-bosh"
npm ERR! cwd E:\nodeJs
npm ERR! node -v v0.10.4
npm ERR! npm -v TypeError: Cannot read property 'node' of undefined
npm ERR! npm -v at E:\nodeJs\node_modules\npm\lib\npm.js:60:38
npm ERR! npm -v at Object. (E:\nodeJs\node_modules\npm\lib\npm.js:511:3)
npm ERR! npm -v at Module._compile (module.js:456:26)
npm ERR! npm -v at Object.Module._extensions..js (module.js:474:10)
npm ERR! npm -v at Module.load (module.js:356:32)
npm ERR! npm -v at Function.Module._load (module.js:312:12)
npm ERR! npm -v at Module.require (module.js:364:17)
npm ERR! npm -v at require (module.js:380:17)
npm ERR! npm -v at E:\nodeJs\node_modules\npm\bin\npm-cli.js:24:11
npm ERR! npm -v at Object. (E:\nodeJs\node_modules\npm\bin\npm-cli.js:86:3)
npm ERR! npm -v [TypeError: Cannot read property 'node' of undefined]
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! E:\nodeJs\npm-debug.log
npm ERR! not ok code 0

@dhruvbird
Copy link
Collaborator

This might be helpful: http://mindon.github.io/blog/2012/06/11/build-node-expat-under-windows/
If not, try opening up an issue on the node-expat page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants