无法使用Grunt和shell(Codebox)下载ace权限错误(虚拟Macine)
从Codebox 0.8.1工作
这是一个包含Codebox用来构build其编辑器插件的3个文件的Gist 。
我在运行virtualbox ubuntu / precise64通过vagrantpipe理cmd运行npm安装所有我很好,但是当我运行sudo npm start
我收到以下内容:
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: '' }
如果我运行npm start
(没有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.
任何帮助将是伟大的?
解决问题后,尝试单独执行每个shell脚本,我发现这是在我的Linux VM中的Windows行结尾的问题。
通过使用这个库的解决schemedos2unix我能够将项目中的所有文件转换为LF(Linux)行结尾。
进入项目目录之后,我所要做的就是运行这个命令:
find . -type f -exec dos2unix {} \;
现在,如果我运行npm start
项目编译正确。
对于其他任何遇到此问题的用户,我build议使用EditorConfig将您的IDE设置为默认LF行结束符。