错误:34,代码:'ENOENT'

时间:2014-09-30 09:49:38

标签: node.js npm avisynth

我试图运行我的项目,但它在整个过程中的某处给了我ENOENT错误。是的,我已经查看了这个similar问题,但其解决方案并不适用于我。

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.

我该如何解决呢?

2 个答案:

答案 0 :(得分:9)

检查你的路径。如果您制作多个级别的目录,通常会得到这个。

例如。如果您需要mkdir('public / projects'),请先确保mkdir('public')然后mkdir('public / projects')

只需演示一些示例脚本:

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);
    })
  }
}

答案 1 :(得分:0)

可能您走错了路。

描绘出跟随路径:

  

/ git / react / my-react-app

如果您位于react文件夹中并尝试运行npm start来启动应用程序,它将提示ENOENT