hybridgroup / cylon-tessel

Cylon adaptor for the Tessel
http://cylonjs.com
Other
13 stars 3 forks source link

Issue with generating tessel project command. #9

Closed jurasec closed 9 years ago

jurasec commented 10 years ago

Hi, I'm testing Cylon with tessel, but I can't generate the project: cylon generate tessel my-tessel-project

Creating new Tessel-ready robot in ./my-tessel-project

usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory

{ [Error: Command failed: usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory ] killed: false, code: 64, signal: null }

My OS versión is: Mac OSX 10.9.4

node & npm ls


MacBook-Pro-de-Julio:tessel jcrodriguez$ node -v
v0.10.26

MacBook-Pro-de-Julio:tessel jcrodriguez$ npm ls
/Users/jcrodriguez/Documents/JuraseC/NodeBots México/tessel
├─┬ cylon@0.18.0
│ ├── async@0.7.0
│ ├─┬ body-parser@1.3.0
│ │ ├── bytes@1.0.0
│ │ ├── qs@0.6.6
│ │ ├── raw-body@1.1.6
│ │ └─┬ type-is@1.2.0
│ │   └── mime@1.2.11
│ ├─┬ express@4.4.1
│ │ ├─┬ accepts@1.0.2
│ │ │ ├── mime@1.2.11
│ │ │ └── negotiator@0.4.5
│ │ ├── buffer-crc32@0.2.1
│ │ ├── cookie@0.1.2
│ │ ├── cookie-signature@1.0.3
│ │ ├── debug@0.8.1
│ │ ├── escape-html@1.0.1
│ │ ├── fresh@0.2.2
│ │ ├── merge-descriptors@0.0.2
│ │ ├── methods@1.0.1
│ │ ├── parseurl@1.0.1
│ │ ├── path-to-regexp@0.1.2
│ │ ├─┬ proxy-addr@1.0.0
│ │ │ └── ipaddr.js@0.1.2
│ │ ├── qs@0.6.6
│ │ ├── range-parser@1.0.0
│ │ ├─┬ send@0.4.1
│ │ │ ├── finished@1.1.4
│ │ │ └── mime@1.2.11
│ │ ├── serve-static@1.2.1
│ │ ├─┬ type-is@1.2.0
│ │ │ └── mime@1.2.11
│ │ └── utils-merge@1.0.0
│ └── robeaux@0.2.0
├─┬ cylon-firmata@0.15.0
│ ├─┬ cylon@0.18.0
│ │ ├── async@0.7.0
│ │ ├─┬ body-parser@1.3.0
│ │ │ ├── bytes@1.0.0
│ │ │ ├── qs@0.6.6
│ │ │ ├── raw-body@1.1.6
│ │ │ └─┬ type-is@1.2.0
│ │ │   └── mime@1.2.11
│ │ ├─┬ express@4.4.1
│ │ │ ├─┬ accepts@1.0.2
│ │ │ │ ├── mime@1.2.11
│ │ │ │ └── negotiator@0.4.5
│ │ │ ├── buffer-crc32@0.2.1
│ │ │ ├── cookie@0.1.2
│ │ │ ├── cookie-signature@1.0.3
│ │ │ ├── debug@0.8.1
│ │ │ ├── escape-html@1.0.1
│ │ │ ├── fresh@0.2.2
│ │ │ ├── merge-descriptors@0.0.2
│ │ │ ├── methods@1.0.1
│ │ │ ├── parseurl@1.0.1
│ │ │ ├── path-to-regexp@0.1.2
│ │ │ ├─┬ proxy-addr@1.0.0
│ │ │ │ └── ipaddr.js@0.1.2
│ │ │ ├── qs@0.6.6
│ │ │ ├── range-parser@1.0.0
│ │ │ ├─┬ send@0.4.1
│ │ │ │ ├── finished@1.1.4
│ │ │ │ └── mime@1.2.11
│ │ │ ├── serve-static@1.2.1
│ │ │ ├─┬ type-is@1.2.0
│ │ │ │ └── mime@1.2.11
│ │ │ └── utils-merge@1.0.0
│ │ └── robeaux@0.2.0
│ ├── cylon-gpio@0.18.0
│ ├── cylon-i2c@0.14.0
│ └─┬ firmata@0.3.3
│   ├── browser-serialport@1.0.6
│   └─┬ serialport@1.4.6
│     ├── async@0.9.0
│     ├── bindings@1.2.1
│     ├── nan@1.3.0
│     ├─┬ node-pre-gyp@0.5.19
│     │ ├─┬ mkdirp@0.5.0
│     │ │ └── minimist@0.0.8
│     │ ├─┬ nopt@2.2.1
│     │ │ └── abbrev@1.0.5
│     │ ├─┬ npmlog@0.0.6
│     │ │ └── ansi@0.2.1
│     │ ├─┬ rc@0.4.0
│     │ │ ├── deep-extend@0.2.10
│     │ │ ├── ini@1.1.0
│     │ │ ├── minimist@0.0.10
│     │ │ └── strip-json-comments@0.1.3
│     │ ├─┬ request@2.36.0
│     │ │ ├── aws-sign2@0.5.0
│     │ │ ├── forever-agent@0.5.2
│     │ │ ├─┬ form-data@0.1.2
│     │ │ │ ├── async@0.2.10
│     │ │ │ └─┬ combined-stream@0.0.4
│     │ │ │   └── delayed-stream@0.0.5
│     │ │ ├─┬ hawk@1.0.0
│     │ │ │ ├── boom@0.4.2
│     │ │ │ ├── cryptiles@0.2.2
│     │ │ │ ├── hoek@0.9.1
│     │ │ │ └── sntp@0.2.4
│     │ │ ├─┬ http-signature@0.10.0
│     │ │ │ ├── asn1@0.1.11
│     │ │ │ ├── assert-plus@0.1.2
│     │ │ │ └── ctype@0.5.2
│     │ │ ├── json-stringify-safe@5.0.0
│     │ │ ├── mime@1.2.11
│     │ │ ├── node-uuid@1.4.1
│     │ │ ├── oauth-sign@0.3.0
│     │ │ ├── qs@0.6.6
│     │ │ ├─┬ tough-cookie@0.12.1
│     │ │ │ └── punycode@1.2.4
│     │ │ └── tunnel-agent@0.4.0
│     │ ├── rimraf@2.2.8
│     │ ├── semver@2.3.0
│     │ ├─┬ tar@0.1.19
│     │ │ ├── block-stream@0.0.7
│     │ │ ├─┬ fstream@0.1.25
│     │ │ │ ├── graceful-fs@2.0.3
│     │ │ │ └── mkdirp@0.3.5
│     │ │ └── inherits@2.0.1
│     │ └─┬ tar-pack@2.0.0
│     │   ├── debug@0.7.4
│     │   ├─┬ fstream@0.1.25
│     │   │ ├── graceful-fs@2.0.3
│     │   │ ├── inherits@2.0.1
│     │   │ └── mkdirp@0.3.5
│     │   ├─┬ fstream-ignore@0.0.7
│     │   │ ├── inherits@2.0.1
│     │   │ └─┬ minimatch@0.2.14
│     │   │   ├── lru-cache@2.5.0
│     │   │   └── sigmund@1.0.0
│     │   ├── graceful-fs@1.2.3
│     │   ├── once@1.1.1
│     │   ├─┬ readable-stream@1.0.27-1
│     │   │ ├── core-util-is@1.0.1
│     │   │ ├── inherits@2.0.1
│     │   │ ├── isarray@0.0.1
│     │   │ └── string_decoder@0.10.25-1
│     │   └── uid-number@0.0.3
│     ├─┬ optimist@0.6.1
│     │ ├── minimist@0.0.10
│     │ └── wordwrap@0.0.2
│     └── sf@0.1.7
├── cylon-gpio@0.18.0
└── cylon-i2c@0.15.0

MacBook-Pro-de-Julio:tessel jcrodriguez$ cylon -v  <====== I dunno why the cylon version is 0.9.1 here, and up says cylon@0.18.0 ======
0.9.1

MacBook-Pro-de-Julio:tessel jcrodriguez$ cylon generate tessel my-tessel-project
Creating new Tessel-ready robot in ./my-tessel-project

usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory

{ [Error: Command failed: usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory
] killed: false, code: 64, signal: null }

Can you help me, please?

Thanks!

zankich commented 10 years ago

@stewart or @solojavier this appears to be a Mac related error, can you take a look at this

stewart commented 10 years ago

Hi @jurasec - this appears to be a paths issue, can you try re-installing the Cylon CLI and trying again?

$ npm uninstall -g cylon-cli
$ npm install -g cylon-cli
$ cylon generate tessel my-tessel-project

Please et me know if this generates the same error.

jurasec commented 10 years ago

Hi @stewart, thanks for your time; I tried again and generates the same error:

MacBook-Pro-de-Julio:tessel jcrodriguez$ ls
blink.js    blinkCylon.js   node_modules    npm-debug.log
MacBook-Pro-de-Julio:tessel jcrodriguez$ sudo npm uninstall -g cylon-cli
Password:
unbuild cylon-cli@0.9.1
MacBook-Pro-de-Julio:tessel jcrodriguez$ npm install -g cylon-cli
npm http GET https://registry.npmjs.org/cylon-cli
npm http 200 https://registry.npmjs.org/cylon-cli
npm http GET https://registry.npmjs.org/restler
npm http GET https://registry.npmjs.org/ejs
npm http GET https://registry.npmjs.org/globule
npm http 200 https://registry.npmjs.org/globule
npm http 200 https://registry.npmjs.org/ejs
npm http 200 https://registry.npmjs.org/restler
npm http GET https://registry.npmjs.org/xml2js/0.4.0
npm http GET https://registry.npmjs.org/yaml/0.2.3
npm http GET https://registry.npmjs.org/iconv-lite/0.2.11
npm http GET https://registry.npmjs.org/qs/0.6.6
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/qs/0.6.6
npm http 200 https://registry.npmjs.org/xml2js/0.4.0
npm http GET https://registry.npmjs.org/xml2js/-/xml2js-0.4.0.tgz
npm http 304 https://registry.npmjs.org/minimatch
npm http 200 https://registry.npmjs.org/yaml/0.2.3
npm http GET https://registry.npmjs.org/yaml/-/yaml-0.2.3.tgz
npm http 200 https://registry.npmjs.org/lodash
npm http 200 https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http 200 https://registry.npmjs.org/xml2js/-/xml2js-0.4.0.tgz
npm http GET https://registry.npmjs.org/inherits
npm http 200 https://registry.npmjs.org/iconv-lite/0.2.11
npm http 200 https://registry.npmjs.org/yaml/-/yaml-0.2.3.tgz
npm http GET https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.11.tgz
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/inherits
npm http 200 https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.11.tgz
npm http GET https://registry.npmjs.org/xmlbuilder
npm http GET https://registry.npmjs.org/sax
npm http 200 https://registry.npmjs.org/xmlbuilder
npm http 200 https://registry.npmjs.org/sax
npm http GET https://registry.npmjs.org/lodash-node
npm http 200 https://registry.npmjs.org/lodash-node
/Users/jcrodriguez/local/bin/cylon -> /Users/jcrodriguez/local/lib/node_modules/cylon-cli/bin/cylon
cylon-cli@0.9.1 /Users/jcrodriguez/local/lib/node_modules/cylon-cli
├── ejs@0.8.8
├── globule@0.2.0 (lodash@2.4.1, minimatch@0.2.14, glob@3.2.11)
└── restler@3.2.2 (qs@0.6.6, yaml@0.2.3, iconv-lite@0.2.11, xml2js@0.4.0)
MacBook-Pro-de-Julio:tessel jcrodriguez$ cylon generate tessel my-tessel-project
Creating new Tessel-ready robot in ./my-tessel-project

usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory

{ [Error: Command failed: usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory
] killed: false, code: 64, signal: null }
MacBook-Pro-de-Julio:tessel jcrodriguez$ ls
blink.js    blinkCylon.js   node_modules
MacBook-Pro-de-Julio:tessel jcrodriguez$ 
stewart commented 10 years ago

At a guess, it's an oddball issue when the generator's trying to find the path to either the target or source directory. Since I can't replicate the issue, I've made a custom branch to debug this, can you try to install and test it?

$ npm uninstall -g cylon-cli
$ npm install -g git://github.com/hybridgroup/cylon-cli.git#jurasec-debug
$ cylon generate tessel my-tessel-project

It should generate some extra debug logging, can you post that?

λ cylon generate tessel my-tessel-project

    process.cwd -> /Users/stewart/dev/cylon-cli
           name -> my-tessel-project
      __dirname -> /Users/stewart/dev/cylon-cli/lib/commands
   template_dir -> /Users/stewart/dev/cylon-cli/lib/commands/support/generate/tessel
destination_dir -> /Users/stewart/dev/cylon-cli/my-tessel-project
        command -> cp -R /Users/stewart/dev/cylon-cli/lib/commands/support/generate/tessel /Users/stewart/dev/cylon-cli/my-tessel-project
jurasec commented 10 years ago

Yep, this is the output:

MacBook-Pro-de-Julio:tessel jcrodriguez$  npm uninstall -g cylon-cli
unbuild cylon-cli@0.9.1
MacBook-Pro-de-Julio:tessel jcrodriguez$ npm install -g git://github.com/hybridgroup/cylon-cli.git#jurasec-debug
npm http GET https://registry.npmjs.org/ejs
npm http GET https://registry.npmjs.org/globule
npm http GET https://registry.npmjs.org/restler
npm http 304 https://registry.npmjs.org/globule
npm http 304 https://registry.npmjs.org/restler
npm http 304 https://registry.npmjs.org/ejs
npm http GET https://registry.npmjs.org/qs/0.6.6
npm http GET https://registry.npmjs.org/xml2js/0.4.0
npm http GET https://registry.npmjs.org/yaml/0.2.3
npm http GET https://registry.npmjs.org/iconv-lite/0.2.11
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/qs/0.6.6
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/yaml/0.2.3
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/iconv-lite/0.2.11
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http GET https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/xml2js/0.4.0
npm http GET https://registry.npmjs.org/sax
npm http GET https://registry.npmjs.org/xmlbuilder
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/sax
npm http 304 https://registry.npmjs.org/xmlbuilder
npm http GET https://registry.npmjs.org/lodash-node
npm http 304 https://registry.npmjs.org/lodash-node
/Users/jcrodriguez/local/bin/cylon -> /Users/jcrodriguez/local/lib/node_modules/cylon-cli/bin/cylon
cylon-cli@0.9.1 /Users/jcrodriguez/local/lib/node_modules/cylon-cli
├── ejs@0.8.8
├── globule@0.2.0 (lodash@2.4.1, minimatch@0.2.14, glob@3.2.11)
└── restler@3.2.2 (qs@0.6.6, yaml@0.2.3, iconv-lite@0.2.11, xml2js@0.4.0)
MacBook-Pro-de-Julio:tessel jcrodriguez$ cylon generate tessel my-tessel-project

    process.cwd -> /Users/jcrodriguez/Documents/JuraseC/NodeBots México/tessel
           name -> my-tessel-project
      __dirname -> /Users/jcrodriguez/local/lib/node_modules/cylon-cli/lib/commands
   template_dir -> /Users/jcrodriguez/local/lib/node_modules/cylon-cli/lib/commands/support/generate/tessel
destination_dir -> /Users/jcrodriguez/Documents/JuraseC/NodeBots México/tessel/my-tessel-project
        command -> cp -R /Users/jcrodriguez/local/lib/node_modules/cylon-cli/lib/commands/support/generate/tessel /Users/jcrodriguez/Documents/JuraseC/NodeBots México/tessel/my-tessel-project

Creating new Tessel-ready robot in ./my-tessel-project

usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory

{ [Error: Command failed: usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory
] killed: false, code: 64, signal: null }
MacBook-Pro-de-Julio:tessel jcrodriguez$ ls
blink.js    blinkCylon.js   node_modules
MacBook-Pro-de-Julio:tessel jcrodriguez$ 
stewart commented 10 years ago

Seems to be an issue with spaces in pathnames, just pushed another commit that removes the logging but should fix the issue. Can you please confirm? Same instructions as my last comment.

jurasec commented 10 years ago

yey!, this is working now :-] Thanks @stewart for your support!

MacBook-Pro-de-Julio:tessel jcrodriguez$ npm uninstall -g cylon-cli
unbuild cylon-cli@0.9.1
MacBook-Pro-de-Julio:tessel jcrodriguez$ npm install -g git://github.com/hybridgroup/cylon-cli.git#jurasec-debug
npm http GET https://registry.npmjs.org/globule
npm http GET https://registry.npmjs.org/restler
npm http GET https://registry.npmjs.org/ejs
npm http 304 https://registry.npmjs.org/restler
npm http 304 https://registry.npmjs.org/globule
npm http 304 https://registry.npmjs.org/ejs
npm http GET https://registry.npmjs.org/qs/0.6.6
npm http GET https://registry.npmjs.org/xml2js/0.4.0
npm http GET https://registry.npmjs.org/yaml/0.2.3
npm http GET https://registry.npmjs.org/iconv-lite/0.2.11
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/qs/0.6.6
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/yaml/0.2.3
npm http 304 https://registry.npmjs.org/iconv-lite/0.2.11
npm http 304 https://registry.npmjs.org/xml2js/0.4.0
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http GET https://registry.npmjs.org/sax
npm http GET https://registry.npmjs.org/xmlbuilder
npm http GET https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/sax
npm http 304 https://registry.npmjs.org/xmlbuilder
npm http GET https://registry.npmjs.org/lodash-node
npm http 304 https://registry.npmjs.org/lodash-node
/Users/jcrodriguez/local/bin/cylon -> /Users/jcrodriguez/local/lib/node_modules/cylon-cli/bin/cylon
cylon-cli@0.9.1 /Users/jcrodriguez/local/lib/node_modules/cylon-cli
├── ejs@0.8.8
├── globule@0.2.0 (lodash@2.4.1, minimatch@0.2.14, glob@3.2.11)
└── restler@3.2.2 (qs@0.6.6, yaml@0.2.3, iconv-lite@0.2.11, xml2js@0.4.0)
MacBook-Pro-de-Julio:tessel jcrodriguez$ cylon generate tessel my-tessel-project
Creating new Tessel-ready robot in ./my-tessel-project

MacBook-Pro-de-Julio:tessel jcrodriguez$ ls 
blink.js        blinkCylon.js       my-tessel-project   node_modules
MacBook-Pro-de-Julio:tessel jcrodriguez$ ls my-tessel-project/
blink.js    package.json
MacBook-Pro-de-Julio:tessel jcrodriguez$ cat my-tessel-project/package.json 
{
  "name": "my-tessel-project",
  "version": "0.0.0",
  "main": "index.js",
  "description": "my-tessel-project",
  "author": {
    "name": "your name here",
    "email": "your email here",
    "url": "your site here"
  },
  "hardware": {
    "*": true,
    "./": true
  },
  "repository": {
    "type": "git",
    "url": "your git uri here"
  },
  "licenses": [
    { "type": "your license here" }
  ],
  "dependencies": {
    "cylon": "~0.18.0",
    "cylon-gpio": "~0.18.0",
    "cylon-tessel": "~0.5.0",
    "cylon-i2c": "~0.14.0"
  }
}
MacBook-Pro-de-Julio:tessel jcrodriguez$