gpt4 book ai didi

node.js - 错误号 : 34, 代码: 'ENOENT'

转载 作者:IT老高 更新时间:2023-10-28 23:08:24 28 4
gpt4 key购买 nike

我试图运行我的项目,但它在途中的某个地方给了我 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.

我该如何解决它

最佳答案

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

例如。如果你需要 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);
})
}
}

关于node.js - 错误号 : 34, 代码: 'ENOENT',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26117752/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com