14

我试图运行我的项目,但它在途中的某个地方给了我 ENOENT 错误。是的,我看过这个类似的问题,但它的解决方案对我不起作用。

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.

我该如何解决

4

2 回答 2

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

于 2014-11-19T20:55:32.087 回答
0

可能你走错了路。

图片如下路径:

/git/react/my-react-app

如果您在该react文件夹中并尝试运行 anpm start来启动您的应用程序,它将提示一个ENOENT.

于 2019-11-28T20:01:18.287 回答