Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Command »npm start --port 8080« fails #535

Closed
jancborchardt opened this issue Nov 9, 2015 · 9 comments · Fixed by #536
Closed

Command »npm start --port 8080« fails #535

jancborchardt opened this issue Nov 9, 2015 · 9 comments · Fixed by #536

Comments

@jancborchardt
Copy link
Contributor

The npm install and build steps work fine. However starting the server results in this:

jan@Rechenknecht:~/shout$ npm start -- --port 8080
npm ERR! Error: ENOENT, open '/home/jan/shout/node_modules/--port/package.json'
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 Linux 3.19.0-31-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "start" "--" "--port" "8080"
npm ERR! cwd /home/jan/shout
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! path /home/jan/shout/node_modules/--port/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/jan/shout/npm-debug.log
npm ERR! not ok code 0

Any idea?

@astorije astorije added the bug label Nov 9, 2015
@astorije
Copy link
Collaborator

astorije commented Nov 9, 2015

Hi @jancborchardt,

I recommend you take a look at https://stackoverflow.com/questions/11580961/sending-command-line-arguments-to-npm-script.

Basically, you cannot pass arguments using npm v1... which is a shame because we ensure support of Node.js v0.10 which comes with npm v1.

The fastest solutions I can offer you is to either use a configuration file instead of command line arguments (http://shout-irc.com/docs/server/configuration.html) or to install shout globally (npm install -g shout).

As a longer-term solution, if we want to support global-free installations, I see 3 possible ways:

  1. Deprecate Node.js 0.10 support. I know @JocelynDelalande will not approve this because it's the version available in Debian Jessie, but fact is Node has seen tremendous major upgrades (v0.12, v4, soon v5...) since then, a merge with iojs, and Node.js v4 is a LTS, first time in Node history. Without trying to be bleeding-edge, if we want to ensure stability, it seems to me than v4 is a much safer choice than v0.10.
  2. Remove CLI arguments. That would mean configuration would come from a single place, the configuration file, which I am cool with.
  3. Update the documentation to warn the user loud and clear that using npm v1 and a local installation prevents using command line arguments.

@floogulinc
Copy link
Collaborator

For now you can use node index --port 8080

Also, why do we have the extra -- in the example on the readme?

@astorije
Copy link
Collaborator

astorije commented Nov 9, 2015

Also, why do we have the extra -- in the example on the readme?

It is necessary with npm. Look at the Stack Overflow link I gave for example.
However, I would definitely remove -- --port 8080 from the README. It is unnecessary for a minimal setup.

@jancborchardt
Copy link
Contributor Author

Aaah ok, just using npm start works fine. That’s all I need. Probably that should be changed in the readme?

@astorije
Copy link
Collaborator

astorije commented Nov 9, 2015

Definitely! Feel free to open a PR for this (Don't forget to take a look at our CONTRIBUTING file first) :-)

@jancborchardt
Copy link
Contributor Author

Will do!

@jancborchardt
Copy link
Contributor Author

PR at #536 and btw it’s awesome to see that this project has picked up more maintainers and pace again. :)

cc @bnvk on these good news as we were keen on contributing to Shout on the design front and it’s probably time to do more on that.

floogulinc added a commit that referenced this issue Nov 9, 2015
fix development setup command, fix #535
@Xe
Copy link
Contributor

Xe commented Nov 9, 2015

@floogulinc

Also, why do we have the extra -- in the example on the readme?

It's behavior based on how GNU getopt() works:

The user can stop getopt() from scanning any further into a command line by using the special argument "--" by itself.

For example:

$ ssh bar.baz -l xena -- tar -xzf some/file 

The -- there stops ssh from processing tar's command line flags.

lucyllewy pushed a commit to lucyllewy/shout that referenced this issue Nov 23, 2015
…ord-change

* 'master' of github.com:erming/shout: (43 commits)
  fix development setup command, fix erming#535
  Limit preview for large image files (fix erming#500)
  Add .editorconfig
  package.json: add linting to `test` script
  Comply with ESLint
  Add .eslintrc
  Added @Xe's tips on the Dockerfile
  Add @floogulinc as a project maintainer
  package.json: add `grunt-cli`
  0.52.0
  Use Node 0.12 to deploy as npm shipping with 0.10 is not compatible for deployment anymore...
  Fix wrong npm token
  Set up automatic deployments on npm
  Add Node.js 4.2 to the list of versions tested by Travis CI
  Revert "Turn off input autocomplete"
  List project maintainers in the CONTRIBUTING file
  Be more explicit on the process workflow in the CONTRIBUTING file
  remove useless Grunt instruction in the doc
  Switch license to verbatim, raw text format
  client/js/shout.js: prevent default action, don't overshadow native keyboard shortcut
  ...
@shrisowdhaman
Copy link

npm start -- --port 3200 -- host 10.0.0.1

Server runs
ng serve --base-href=/URL/ "--host" "10.97.7.78" "--port" "3400"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants