Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Double char at prompt when deploying with empty scripts.start #306

Closed
ghost opened this Issue · 9 comments

3 participants

@ghost

I justed tested out jitsu a bit more. jitsu deploy seems to warn twice for me and then listening to the input, so that every char entered is displayed twice.

info:    It worked if it ends with Nodejitsu ok
info:    Executing command deploy
warn:
warn:    The package.json file is missing required fields:
warn:
warn:      scripts.start
warn:
warn:    Prompting user for required fields.
warn:    Press ^C at any time to quit.
warn:
prompt: scripts.start:
warn:    About to write /home/$user/node/package.json
data:
data:    {
data:        engines: { node: '0.8.x' },
data:        scripts: { start: '' },
data:        name: 'test',
data:        version: '0.0.1',
data:        subdomain: 'test'
data:    }
data:
prompt: Is this ok?:  (yes)
info:    Analyzing application dependencies in
path.exists is now called `fs.exists`.
warn:
warn:    The package.json file is missing required fields:
warn:
warn:      scripts.start
warn:
warn:    Prompting user for required fields.
warn:    Press ^C at any time to quit.
warn:
prompt: scripts.start:  warn:
warn:    The package.json file is missing required fields:
warn:
warn:      scripts.start
warn:
warn:    Prompting user for required fields.
warn:    Press ^C at any time to quit.
warn:
prompt: scripts.start: hheelloowwoorrlldd
@blakmatrix

What node version are you using?, you should not be seeing path.exists is now calledfs.exists. anymore

@ghost

node -v
v0.8.8

Using jitsu 0.9.8
The path.exists is now calledfs.exists. could be from all the modules still using it...

find ./lib/node_modules -name "*" -exec grep -l "path.exists" {} \;

./jitsu/node_modules/flatiron/node_modules/broadway/node_modules/winston/node_modules/async/README.md
./jitsu/node_modules/flatiron/node_modules/broadway/node_modules/winston/node_modules/async/package.json
./jitsu/node_modules/flatiron/node_modules/broadway/node_modules/winston/test/log-exception-test.js
./jitsu/node_modules/flatiron/node_modules/broadway/node_modules/nconf/node_modules/async/README.md
./jitsu/node_modules/flatiron/node_modules/broadway/node_modules/nconf/node_modules/async/package.json
./jitsu/node_modules/flatiron/node_modules/broadway/node_modules/nconf/docs/nconf/stores/file.html
./jitsu/node_modules/flatiron/node_modules/broadway/node_modules/nconf/lib/nconf/stores/file.js
./jitsu/node_modules/flatiron/node_modules/broadway/node_modules/utile/node_modules/mkdirp/test/umask_sync.js
./jitsu/node_modules/flatiron/node_modules/broadway/node_modules/utile/node_modules/mkdirp/test/perm.js
./jitsu/node_modules/flatiron/node_modules/broadway/node_modules/utile/node_modules/mkdirp/test/mkdirp.js
./jitsu/node_modules/flatiron/node_modules/broadway/node_modules/utile/node_modules/mkdirp/test/perm_sync.js
./jitsu/node_modules/flatiron/node_modules/broadway/node_modules/utile/node_modules/mkdirp/test/race.js
./jitsu/node_modules/flatiron/node_modules/broadway/node_modules/utile/node_modules/mkdirp/test/umask.js
./jitsu/node_modules/flatiron/node_modules/broadway/node_modules/utile/node_modules/mkdirp/test/rel.js
./jitsu/node_modules/flatiron/node_modules/broadway/node_modules/utile/node_modules/mkdirp/test/sync.js
./jitsu/node_modules/flatiron/node_modules/broadway/node_modules/utile/node_modules/async/README.md
./jitsu/node_modules/flatiron/node_modules/broadway/node_modules/utile/node_modules/async/package.json
./jitsu/node_modules/flatiron/node_modules/broadway/test/helpers/assert.js
./jitsu/node_modules/flatiron/node_modules/broadway/test/common/directories-test.js
./jitsu/node_modules/flatiron/node_modules/prompt/node_modules/winston/node_modules/async/README.md
./jitsu/node_modules/flatiron/node_modules/prompt/node_modules/winston/node_modules/async/package.json
./jitsu/node_modules/flatiron/node_modules/prompt/node_modules/winston/test/log-exception-test.js
./jitsu/node_modules/flatiron/node_modules/prompt/node_modules/utile/node_modules/mkdirp/test/umask_sync.js
./jitsu/node_modules/flatiron/node_modules/prompt/node_modules/utile/node_modules/mkdirp/test/perm.js
./jitsu/node_modules/flatiron/node_modules/prompt/node_modules/utile/node_modules/mkdirp/test/mkdirp.js
./jitsu/node_modules/flatiron/node_modules/prompt/node_modules/utile/node_modules/mkdirp/test/perm_sync.js
./jitsu/node_modules/flatiron/node_modules/prompt/node_modules/utile/node_modules/mkdirp/test/race.js
./jitsu/node_modules/flatiron/node_modules/prompt/node_modules/utile/node_modules/mkdirp/test/umask.js
./jitsu/node_modules/flatiron/node_modules/prompt/node_modules/utile/node_modules/mkdirp/test/rel.js
./jitsu/node_modules/flatiron/node_modules/prompt/node_modules/utile/node_modules/mkdirp/test/sync.js
./jitsu/node_modules/flatiron/node_modules/prompt/node_modules/utile/node_modules/async/README.md
./jitsu/node_modules/flatiron/node_modules/prompt/node_modules/utile/node_modules/async/package.json
./jitsu/node_modules/flatiron/node_modules/director/test/browser/backend/backend.js
./jitsu/node_modules/flatiron/lib/flatiron/cli/create.js
./jitsu/node_modules/flatiron/lib/flatiron/plugins/resourceful.js
./jitsu/node_modules/npm/node_modules/mkdirp/test/umask_sync.js
./jitsu/node_modules/npm/node_modules/mkdirp/test/perm.js
./jitsu/node_modules/npm/node_modules/mkdirp/test/mkdirp.js
./jitsu/node_modules/npm/node_modules/mkdirp/test/perm_sync.js
./jitsu/node_modules/npm/node_modules/mkdirp/test/race.js
./jitsu/node_modules/npm/node_modules/mkdirp/test/umask.js
./jitsu/node_modules/npm/node_modules/mkdirp/test/rel.js
./jitsu/node_modules/npm/node_modules/mkdirp/test/sync.js
./jitsu/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js
./jitsu/node_modules/npm/node_modules/node-gyp/legacy/tools/gyp_addon
./jitsu/node_modules/npm/node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/generator/msvs.py
./jitsu/node_modules/npm/node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/generator/make.py
./jitsu/node_modules/npm/node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/generator/scons.py
./jitsu/node_modules/npm/node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/input.py
./jitsu/node_modules/npm/node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/mac_tool.py
./jitsu/node_modules/npm/node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/xcodeproj_file.py
./jitsu/node_modules/npm/node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/common.py
./jitsu/node_modules/npm/node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/MSVSVersion.py
./jitsu/node_modules/npm/node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/init.py
./jitsu/node_modules/npm/test/tap/false_name.js
./jitsu/node_modules/fstream/node_modules/mkdirp/test/umask_sync.js
./jitsu/node_modules/fstream/node_modules/mkdirp/test/perm.js
./jitsu/node_modules/fstream/node_modules/mkdirp/test/mkdirp.js
./jitsu/node_modules/fstream/node_modules/mkdirp/test/perm_sync.js
./jitsu/node_modules/fstream/node_modules/mkdirp/test/race.js
./jitsu/node_modules/fstream/node_modules/mkdirp/test/umask.js
./jitsu/node_modules/fstream/node_modules/mkdirp/test/rel.js
./jitsu/node_modules/fstream/node_modules/mkdirp/test/sync.js
./jitsu/node_modules/wizard/node_modules/prompt/node_modules/winston/node_modules/async/README.md
./jitsu/node_modules/wizard/node_modules/prompt/node_modules/winston/node_modules/async/package.json
./jitsu/node_modules/wizard/node_modules/prompt/node_modules/winston/test/log-exception-test.js
./jitsu/node_modules/wizard/node_modules/prompt/node_modules/utile/node_modules/mkdirp/test/umask_sync.js
./jitsu/node_modules/wizard/node_modules/prompt/node_modules/utile/node_modules/mkdirp/test/perm.js
./jitsu/node_modules/wizard/node_modules/prompt/node_modules/utile/node_modules/mkdirp/test/mkdirp.js
./jitsu/node_modules/wizard/node_modules/prompt/node_modules/utile/node_modules/mkdirp/test/perm_sync.js
./jitsu/node_modules/wizard/node_modules/prompt/node_modules/utile/node_modules/mkdirp/test/race.js
./jitsu/node_modules/wizard/node_modules/prompt/node_modules/utile/node_modules/mkdirp/test/umask.js
./jitsu/node_modules/wizard/node_modules/prompt/node_modules/utile/node_modules/mkdirp/test/rel.js
./jitsu/node_modules/wizard/node_modules/prompt/node_modules/utile/node_modules/mkdirp/test/sync.js
./jitsu/node_modules/wizard/node_modules/prompt/node_modules/utile/node_modules/async/README.md
./jitsu/node_modules/wizard/node_modules/prompt/node_modules/utile/node_modules/async/package.json
./jitsu/node_modules/require-analyzer/node_modules/winston/node_modules/async/README.md
./jitsu/node_modules/require-analyzer/node_modules/winston/node_modules/async/package.json
./jitsu/node_modules/require-analyzer/node_modules/winston/test/log-exception-test.js
./jitsu/node_modules/require-analyzer/lib/require-analyzer.js
./jitsu/node_modules/request/node_modules/form-data/node_modules/async/README.md
./jitsu/lib/jitsu/package.js
./jitsu/lib/jitsu/commands/install.js

@ghost

Okay, I took a look at all these files: it's the require analyzer! I'll open up a pull request in there. But that was way more a side issue ;-)

@jfhbrook

That's very interesting. I'm going to see if I can reproduce. Do you have any ideas as to why/how you got it to prompt twice? Even given that, this seems like unexpected behavior to me on the part of the prompt module.

@jfhbrook

@wibuni I'm having trouble reproducing this with master jitsu and prompt:

josh@onix:/tmp/helloworld$ jitsu deploy --analyze
info:    Welcome to Nodejitsu jesusabdullah
info:    jitsu v0.9.8
info:    It worked if it ends with Nodejitsu ok
info:    Executing command deploy
warn:    
warn:    The package.json file is missing required fields:
warn:    
warn:      scripts.start
warn:    
warn:    Prompting user for required fields.
warn:    Press ^C at any time to quit.
warn:    
prompt: scripts.start:  (bin/server) 
warn:    About to write /tmp/helloworld/package.json
data:    
data:    {
data:        keywords: [ 'nodeapps', 'helloworld' ],
data:        dist: { shasum: 'becbebf206d8d98c2058fa0b8f0437c9b2a119b3' },
data:        version: '0.2.1',
data:        readme: '# Node Apps\n## helloworld\n\n# Installation\n\n    mkdir myapp\n    cd myapp/\n    jitsu install helloworld\n\n*If you do not have `jitsu` installed you can install it via `npm install jitsu -g`*\n\n\n# Usage\n\n### Starting helloworld locally\n\n    node bin/server\n\n*Now you can visit http://localhost:8080 to view your application*\n\n### Deploy helloworld to nodejitsu\n\n    jitsu deploy\n\n*You will now be prompted for a `subdomain` to deploy your application on*\n\n\n# License\n\n(The MIT License)\n\nCopyright (c) 2011 Nodejitsu\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.',
data:        contributors: [
data:            { name: 'Marak Squires', email: 'marak.squires@gmail.com' },
data:            { name: 'Joshua Holbrook', email: 'josh.holbrook@gmail.com' },
data:            { name: 'Farrin Reid', email: 'blakmatrix@gmail.com' }
data:        ],
data:        dependencies: {},
data:        name: 'nodeapps-helloworld',
data:        main: '',
data:        author: { name: 'Nodejitsu Inc.', email: 'support@nodejitsu.com' },
data:        subdomain: 'yodawg',
data:        licenses: [
data:            { url: 'https://github.com/nodeapps/helloworld/raw/master/LICENSE', type: 'MIT' }
data:        ],
data:        scripts: { start: 'bin/server' },
data:        engines: { node: '>=0.4' },
data:        homepage: 'http://nodeapps.github.com/helloworld',
data:        description: 'A very basic node.js helloworld application',
data:        bugs: { url: 'https://github.com/nodeapps/helloworld/issues' },
data:        repository: { url: 'git://github.com/nodeapps/helloworld.git', type: 'git' },
data:        devDependencies: {}
data:    }
data:    
prompt: Is this ok?:  (yes) 
info:    Analyzing application dependencies in bin/server
info:    Checking app availability nodeapps-helloworld
^C

Maybe npm's cache is borked on your system? You can get these to un-stick by uninstalling jitsu, clearing the npm cache (nice: npm cache clean, nuke: rm -rf ~/.npm), and then running npm install jitsu -g.

One other question: Which OS are you using? It's possible this is a windows-specific problem.

@ghost

@jesusabdullah But as you're posting your output, there are some more differences (as there is the standard argument (bin/server), that isn't displayed anywhere at me.

For reproducting, I did the following: fresh installation of whole npm packages and jitsu, then creating a new application with the jitsu install tool and just hit 'enter' all the time. With jitsu deploy the error consists. Tried with node 0.8.8 running native on Windows 7 and running on CentOS.

I'll investigate on the next days and could hopefully tell you more then :)

@ghost

Hi @jesusabdullah.
I now checked this out again with a MacBook Pro on OS X Mountain Lion and got the same issue. So it's definitely not just a windows bug but concerning all OS. Tested on Windows 7, CentOS and now Mountain Lion.

Here are the steps in detail:
1. mkdir test && cd test
2. jitsu install, press ENTER to install helloworld example, enter no when prompting for local node run
3. jitsu deploy, enter some random data for name, subdomain, leave blank all other fields. Press ENTER when prompting for Is this okay?. When package.json is written and jitsu begins to deploy, you can abort (no need to deploy it now)
4. Again, jitsu deploy, now jitsu will grumble that scripts.start is empty. Just leave it empty and press ENTER. Then Is this okay? -> ENTER. Now jitsu will again prompt you for scripts.start, but this time, the prompt directly comes twice with the double char issue above.

There is probably any double callback... I didn't looked that up in source code yet, but if do jitsu deploy --noanalyze, the issue seems to be gone (can't yet confirm that on all OS).

@yawnt

this one should be fixed with nodejitsu/require-analyzer#55

i think we can close it

@jfhbrook

Hmm.

That fixes the side issue for sure, but I don't think that fixes the double-prompting bug originally reported.

That said, none of us were ever able to repro this, and believe me when I say we tried. Plus, after a month I would've thought someone would've confirmed. So, I'm going to close this with the assumption that it's not a confirmed bug.

@wibuni in your case this may be a weird miss-matched versions issue or something. If you want to dig into the code feel free to, if you do find a weird edge case in there I'd definitely be interested in hearing about it.

@jfhbrook jfhbrook closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.