16

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

Community
  • 1
  • 1
bapzangbo
  • 163
  • 1
  • 1
  • 5

2 Answers2

11

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);
    })
  }
}
Chris Lee
  • 126
  • 5
0

Probably you are on the wrong path.

picture the follow path:

/git/react/my-react-app

if you are on the react folder and try to run a npm start to start up your application, it will prompt an ENOENT.