CodeboxIDE / codebox

Open source cloud & desktop IDE
https://www.codebox.io
Apache License 2.0
4.11k stars 589 forks source link

Cannot build cb.files.editor (cannot download ace) #438

Closed chopfitzroy closed 10 years ago

chopfitzroy commented 10 years ago

Working from codebox 0.8.1

I am on windows running virtualbox ubuntu/precise64 through vagrant in administrative cmd when running npm install all i fine but when I sudo run npm start I receive the following:

Building addons in ./addons/ (force=false)
Optimizing cb.files.editor
error for optimization of cb.files.editor
options= { baseUrl: 'addons/cb.files.editor',
  name: 'client',
  out: '/project/addons/cb.files.editor/addon-built.js',
  paths: { 'require-tools': '/project/core/cb.addons/require-tools' },
  optimize: 'uglify',
  map:
   { '*':
      { css: 'require-tools/css/css',
        less: 'require-tools/less/less',
        text: 'require-tools/text/text' } } }
{ [Error: Command failed: node /project/node_modules/requirejs/bin/r.js -o baseUrl=addons/cb.files.editor name=client out=/project/addons/cb.files.editor/addon-built.js paths.requi
re-tools=/project/core/cb.addons/require-tools optimize=uglify map.*.css=require-tools/css/css map.*.less=require-tools/less/less map.*.text=require-tools/text/text  (exited with e
rror code 1)]
  killed: false,
  code: 1,
  signal: null,
  stdout: '\nTracing dependencies for: client\nError: ENOENT, no such file or directory \'/project/addons/cb.files.editor/ace/ace.js\'\nIn module tree:\n    client\n      ace\n\nEr
ror: Error: ENOENT, no such file or directory \'/project/addons/cb.files.editor/ace/ace.js\'\nIn module tree:\n    client\n      ace\n\n    at Object.fs.openSync (fs.js:432:18)\n\n
',
  stderr: '' }

If I run npm start (no sudo):

Running "exec:build_files_editor" (exec) task
>> npm
>> 
>> WARN
>> 
>> package.json
>> cb.files.editor@0.1.1 No repository field.
>> npm
>> 
>> WARN
>> 
>> package.json
>> cb.files.editor@0.1.1 No README data

> cb.files.editor@0.1.1 postinstall /project/addons/cb.files.editor
> ./download_ace.sh && ./build.sh

>> sh: 1:
>> ./download_ace.sh: not found
>> 
>> npm ERR! weird error 127
>> npm
>> WARN This failure might be due to the use of legacy binary "node"
>> npm WARN For further explanations, please read
>> /usr/share/doc/nodejs/README.Debian
>> npm
>> 
>> ERR!
>> 
>> not ok
>> code 0
>> Exited with code: 1.
Warning: Task "exec:build_files_editor" failed. Use --force to continue.

Any suggestions would be great.

chopfitzroy commented 10 years ago

My problem was line endings as it turns out windows was converting all the project source files over to CRLF line endings which the machine could not understand.

In the end the answer was in VM install dos2unix : sudo apt-get install dos2unix

Then run find . -type f -exec dos2unix {} \; to convert all the files in the project directory over to LF line endings.

If you are planning on editing your Codebox project in windows and compiling in Linux VM I would recommend EditorConfig (if your IDE supports it) as this allows you to standardize line endings (even in a windows environment).