monaca / monaca-cli

Command line version of Monaca
Other
44 stars 14 forks source link

Monaca Command is Still Not Working #31

Closed jdtzmn closed 9 years ago

jdtzmn commented 9 years ago

This is what happens when I try running monaca:

$ sudo npm install -g monaca $ monaca : No such file or directory

That's all it says. I've also tried $ sudo monaca but to no avail...

(This time please ask before closing issue so that I can tell you if it is really working).

masahirotanaka commented 9 years ago

Thanks for the comment. I actually confirmed it is running well in my Mac OS X environment.

Can you please execute the following commands to see what happens?

$ which monaca
$ node `which monaca` -v
$ node /usr/local/lib/node_modules/monaca/bin/monaca
$ ls -la `which monaca`

Thanks so much!

jdtzmn commented 9 years ago
$ which monaca
/usr/local/bin/monaca
$ node `which monaca` -v
                            (<---- Blank space)
$ node /usr/local/lib/node_modules/monaca/bin/monaca
 __  __                             
|  \/  | ___  _ __   __ _  ___ __ _ 
| |\/| |/ _ \| '_ \ / _` |/ __/ _` |
| |  | | (_) | | | | (_| | (_| (_| |
|_|  |_|\___/|_| |_|\__,_|\___\__,_|

 Version 1.2.0

Usage: monaca command [args]

Description:

  Monaca command-line interface.

  To learn about a specific command type:

  $ monaca <command> --help

Commands:

  create  ........  create a new Monaca project
  plugin  ........  manage installed plugins
  login  .........  sign in to Monaca Cloud
  logout  ........  sign out from Monaca Cloud
  clone  .........  clone project from the Monaca Cloud
  import  ........  import project from the Monaca Cloud
  upload  ........  upload project to Monaca Cloud
  download  ......  download project from Monaca Cloud
  livesync  ......  starts a server that waits for connections from Monaca Debugger
  multiserve  ....  serves several projects to the Monaca Debugger
  remote build  ..  build project on Monaca Cloud
  proxy  .........  configure proxy to use when connecting to Monaca Cloud

Examples:

  $ monaca create myproject
  $ cd myproject
  $ monaca build
  $ monaca run android

$ ls -la `which monaca`
lrwxrwxrwx 1 root root 37 Aug 19 17:22 /usr/local/bin/monaca ->

$
masahirotanaka commented 9 years ago

Looks like you are still using the older version. Please do

sudo npm -g install monaca

to update to the latest version.

jdtzmn commented 9 years ago
$ sudo npm  -g install monaca
> monaca@1.2.3 preinstall /usr/lib/node_modules/monaca
> node bin/preinstall

Success: Confirmed that the dependent components are installed.
npm WARN engine hawk@3.1.0: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"2.13.5"})

> nw@0.12.3 postinstall /usr/lib/node_modules/monaca/node_modules/nw
> node scripts/install.js

npm WARN engine cordova-serve@0.1.3: wanted: {"node":">= 0.12.0","npm":">= 2.5.1"} (current: {"node":"0.10.25","npm":"2.13.5"})
npm WARN engine hawk@3.1.0: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"2.13.5"})
/usr/bin/monaca -> /usr/lib/node_modules/monaca/bin/monaca
monaca@1.2.3 /usr/lib/node_modules/monaca
├── colors@0.6.2
├── open@0.0.5
├── xmldom@0.1.19
├── q@1.4.1
├── read@1.0.7 (mute-stream@0.0.5)
├── shelljs@0.3.0
├── fs-extra@0.18.4 (jsonfile@2.2.1, graceful-fs@3.0.8)
├── optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10)
├── rimraf@2.4.3 (glob@5.0.14)
├── unzip@0.1.11 (setimmediate@1.0.2, pullstream@0.4.1, readable-stream@1.0.33, match-stream@0.0.2, binary@0.3.0, fstream@0.1.31)
├── monaca-lib@1.1.5 (qlimit@0.1.1, padlock@1.1.2, buffer-crc32@0.2.5, extend@2.0.1, lockfile@1.0.1, async@0.9.2, watch@0.13.0, sse@0.0.6, tmp@0.0.26, portfinder@0.4.0, decompress-unzip@3.3.0, request@2.61.0, decompress@2.3.0, nconf@0.7.2, adbkit@2.3.1, xml2js@0.4.12)
├── cordova@5.2.0 (underscore@1.7.0, q@1.0.1, nopt@3.0.1, cordova-lib@5.2.0)
└── nw@0.12.3 (file-exists@0.1.1, merge@1.2.0, semver@4.3.6, chalk@1.0.0, multimeter@0.1.1, yargs@3.24.0, decompress@2.3.0, download@3.3.0)
$ monaca
: No such file or directory
jdtzmn commented 9 years ago

I just tried: $ sudo link /usr/bin/monaca /usr/local/lib/node_modules/monaca/bin/monaca Then:

$ monaca
: No such file or directory

And yet this worked: $ /usr/bin/monaca

Hope this helps!

masahirotanaka commented 9 years ago

What I see is that previously monaca command was installed in /usr/local/bin/monaca. However, when you run npm -g install it looks like it installs to /usr/bin/monaca. I think this is the main cause of the error.

Therefore, if you do rm /usr/local/bin/monaca I think the problem will be fixed.

jdtzmn commented 9 years ago

I fixed it by:

$ sudo rm /usr/local/bin/monaca
$ monaca
bash: /usr/local/bin/monaca: No such file or directory
$ sudo npm install -g monaca
$ sudo link /usr/local/bin/monaca /usr/local/lib/node_modules/monaca/bin/monaca
$ monaca
bash: /usr/local/bin/monaca: Permission denied
$ sudo monaca
 __  __                             
|  \/  | ___  _ __   __ _  ___ __ _ 
| |\/| |/ _ \| '_ \ / _` |/ __/ _` |
| |  | | (_) | | | | (_| | (_| (_| |
|_|  |_|\___/|_| |_|\__,_|\___\__,_|

 Version 1.2.0

Usage: monaca command [args]

Description:

  Monaca command-line interface.

  To learn about a specific command type:

  $ monaca <command> --help

Commands:

  create  ........  create a new Monaca project
  plugin  ........  manage installed plugins
  login  .........  sign in to Monaca Cloud
  logout  ........  sign out from Monaca Cloud
  clone  .........  clone project from the Monaca Cloud
  import  ........  import project from the Monaca Cloud
  upload  ........  upload project to Monaca Cloud
  download  ......  download project from Monaca Cloud
  livesync  ......  starts a server that waits for connections from Monaca Debugger
  multiserve  ....  serves several projects to the Monaca Debugger
  remote build  ..  build project on Monaca Cloud
  proxy  .........  configure proxy to use when connecting to Monaca Cloud

Examples:

  $ monaca create myproject
  $ cd myproject
  $ monaca build
  $ monaca run android
masahirotanaka commented 9 years ago

Congrats!

$ monaca
bash: /usr/local/bin/monaca: Permission denied

Maybe this can be fixed by running the following command:

chmod go+x /usr/local/bin/monaca