jcoglan / vault

Generates safe passwords so you never need to remember them
https://getvau.lt
471 stars 64 forks source link

postinstall.js script throws error on windows -- vault does not install #14

Closed TexRx closed 10 years ago

TexRx commented 10 years ago

I tried to install vault on windows via cmd line npm install -g vault. Everything is cool until postinstall.js is run. This file only outputs a warning about upgrading, so to get around the issue, I cloned the repo, removed the postinstall call from the package.json "scripts" section, then ran npm install locally. This worked. Just wanted to let you know.

jcoglan commented 10 years ago

Thanks. I guess this is because it uses #!/usr/bin/env node instead of node postinstall in the scripts section, and Windows doesn't know how to execute it. The script will probably be gone in the next release anyway.

panesofglass commented 10 years ago

I'm still getting the same issue, though you may not have released a new version yet. In case it helps, here's the output:

$ npm install -g vault
npm http GET https://registry.npmjs.org/vault
npm http 200 https://registry.npmjs.org/vault
npm http GET https://registry.npmjs.org/pw
npm http GET https://registry.npmjs.org/ssh-agent
npm http GET https://registry.npmjs.org/posix-argv-parser
npm http GET https://registry.npmjs.org/vault-cipher
npm http 200 https://registry.npmjs.org/posix-argv-parser
npm http 200 https://registry.npmjs.org/pw
npm http 200 https://registry.npmjs.org/ssh-agent
npm http 200 https://registry.npmjs.org/vault-cipher
npm http GET https://registry.npmjs.org/ctype/0.5.0
npm http GET https://registry.npmjs.org/posix-getopt/1.0.0
npm http 200 https://registry.npmjs.org/ctype/0.5.0
npm http GET https://registry.npmjs.org/ctype/-/ctype-0.5.0.tgz
npm http 200 https://registry.npmjs.org/posix-getopt/1.0.0
npm http GET https://github.com/cujojs/when/tarball/1.3.0
npm http GET https://registry.npmjs.org/posix-getopt/-/posix-getopt-1.0.0.tgz
npm http 200 https://registry.npmjs.org/ctype/-/ctype-0.5.0.tgz
npm http 200 https://registry.npmjs.org/posix-getopt/-/posix-getopt-1.0.0.tgz
npm http 200 https://github.com/cujojs/when/tarball/1.3.0
C:\Users\Ryan\AppData\Roaming\npm\vault -> C:\Users\Ryan\AppData\Roaming\npm\node_modules\vault\bin\vault

> vault@0.3.0 postinstall C:\Users\Ryan\AppData\Roaming\npm\node_modules\vault
> ./node/scripts/postinstall

'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! vault@0.3.0 postinstall: `./node/scripts/postinstall`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vault@0.3.0 postinstall script.
npm ERR! This is most likely a problem with the vault package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ./node/scripts/postinstall
npm ERR! You can get their info via:
npm ERR!     npm owner ls vault
npm ERR! There is likely additional logging output above.

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" "vault"
npm ERR! cwd C:\Users\Ryan
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\Ryan\npm-debug.log
npm ERR! not ok code 0

If I do the same locally with v0.4.0 without removing postInstall, I get:

C:\Users\Ryan\Code\vault [master]> npm install -g
npm http GET https://registry.npmjs.org/ssh-agent
npm http GET https://registry.npmjs.org/pw
npm http GET https://registry.npmjs.org/posix-argv-parser
npm http GET https://registry.npmjs.org/vault-cipher
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/ssh-agent
npm http 304 https://registry.npmjs.org/pw
npm http 304 https://registry.npmjs.org/vault-cipher
npm http 304 https://registry.npmjs.org/posix-argv-parser
npm http 200 https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/posix-argv-parser/-/posix-argv-parser-1.0.0.tgz
npm http 200 https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/async/-/async-0.2.10.tgz
npm http 200 https://registry.npmjs.org/posix-argv-parser/-/posix-argv-parser-1.0.0.tgz
npm http 200 https://registry.npmjs.org/async/-/async-0.2.10.tgz
npm http GET https://registry.npmjs.org/ctype/0.5.0
npm http GET https://registry.npmjs.org/posix-getopt/1.0.0
npm http GET https://github.com/cujojs/when/tarball/1.8.1
npm http 304 https://registry.npmjs.org/ctype/0.5.0
npm http 304 https://registry.npmjs.org/posix-getopt/1.0.0
npm http 200 https://github.com/cujojs/when/tarball/1.8.1
C:\Users\Ryan\AppData\Roaming\npm\vault -> C:\Users\Ryan\AppData\Roaming\npm\node_modules\vault\bin\vault

> vault@0.4.0 postinstall C:\Users\Ryan\AppData\Roaming\npm\node_modules\vault
> ./node/scripts/postinstall

'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! vault@0.4.0 postinstall: `./node/scripts/postinstall`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vault@0.4.0 postinstall script.
npm ERR! This is most likely a problem with the vault package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ./node/scripts/postinstall
npm ERR! You can get their info via:
npm ERR!     npm owner ls vault
npm ERR! There is likely additional logging output above.

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"
npm ERR! cwd C:\Users\Ryan\Code\vault
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\Ryan\Code\vault\npm-debug.log
npm ERR! not ok code 0