Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

errno: 34, code: 'ENOENT'

I tried to run my project , but it gave me the ENOENT error somewhere along the way. Yes I have looked at this similar question, but its solution doesn't work for me.

PROJECTS.JS::CREATED 542a78fcaa50f4260d1e52a5
{ [Error: ENOENT, mkdir '/home/haint/avs3_tmp/html5-videoEditor-master/modules/..                      /public/projects/ca62a6012db5454fb0ba41d35f61afe6']
errno: 34,
code: 'ENOENT',
path: '/home/haint/avs3_tmp/html5-videoEditor-master/modules/../public/projects                    /ca62a6012db5454fb0ba41d35f61afe6' }
{ [Error: ENOENT, mkdir '/home/haint/avs3_tmp/html5-videoEditor-master/modules/..                /public/projects/ca62a6012db5454fb0ba41d35f61afe6/assets/']
errno: 34,
code: 'ENOENT',
path: '/home/haint/avs3_tmp/html5-videoEditor-master/modules/../public/projects                /ca62a6012db5454fb0ba41d35f61afe6/assets/' }
{ [Error: ENOENT, mkdir '/home/haint/avs3_tmp/html5-videoEditor-master/modules/..                /public/projects/ca62a6012db5454fb0ba41d35f61afe6/compositions/']
errno: 34,
code: 'ENOENT',
path: '/home/haint/avs3_tmp/html5-videoEditor-master/modules/../public/projects                /ca62a6012db5454fb0ba41d35f61afe6/compositions/' }
PROJECTS.JS::FOUND 542a78fcaa50f4260d1e52a5   
PROJECTS.JS::LIBRARY SERVED WITH 0 ASSETS
PROJECTS.JS::COMPOSITIONS SERVED WITH 0 COMPS.

how can i fix it

like image 893
bapzangbo Avatar asked Sep 30 '14 09:09

bapzangbo


People also ask

What is code ENOENT?

ENOENT typically means the file/directory doesn't exist.


1 Answers

Check your path. If you were making multiple levels of directories, you will usually get this.

For example. if you need to mkdir('public/projects'), make sure you mkdir('public') first then mkdir('public/projects')

Just some sample scripts to demo:

var fs = require('fs');

var f = '/css/colors';

var dirs = f.split('/');

var newDir = __dirname;

for (var i = 0; i < dirs.length; i++) {
  newDir += dirs[i] + '/';
  console.log(newDir);

  if (!fs.exists(newDir)) {
    fs.mkdir(newDir, function(error) {
      console.log(error);
    })
  }
}
like image 119
Chris Lee Avatar answered Sep 16 '22 17:09

Chris Lee