1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[React] Projeto react criado via yarn retorna erro ao uar yarn start

Discussão em 'Mobile' iniciado por Stack, Setembro 21, 2021.

  1. Stack

    Stack Membro Participativo

    Todo projeto react que eu crio usando o comando yarn create react-app "nomedoapp" --template=typecript me retorna esse erro na hora de usar o yarn start

    [​IMG]

    Na minha pasta mode_modules/upath não possui a pasta build apresentada no erro, porém o arquivo .json presente na pasta upath contém isso:

    "name": "upath",
    "description": "A proxy to `path`, replacing `\\` with `/` for all results & new methods to normalize & join keeping leading `./` and add, change, default, trim file extensions.",
    "version": "1.2.0",
    "homepage": "http://github.com/anodynos/upath/",
    "author": {
    "name": "Angelos Pikoulas",
    "email": "agelos.pikoulas@gmail.com"
    },
    "license": "MIT",
    "keywords": [
    "path",
    "unix",
    "windows",
    "extension",
    "file extension",
    "replace extension",
    "change extension",
    "trim extension",
    "add extension",
    "default extension"
    ],
    "repository": {
    "type": "git",
    "url": "git://github.com/anodynos/upath"
    },
    "bugs": {
    "url": "http://github.com/anodynos/upath/issues",
    "email": "agelos.pikoulas@gmail.com"
    },
    "main": "./build/code/upath.js",
    "types": "./upath.d.ts",
    "preferGlobal": false,
    "scripts": {
    "test": "grunt",
    "build": "grunt lib"
    },
    "directories": {
    "doc": "./doc",
    "dist": "./build"
    },
    "engines": {
    "node": ">=4",
    "yarn": "*"
    },
    "devDependencies": {
    "chai": "~4.0.2",
    "coffee-script": "1.12.6",
    "grunt": "0.4.5",
    "grunt-contrib-watch": "^1.1.0",
    "grunt-urequire": "0.7.x",
    "lodash": "^4.17.15",
    "mocha": "~3.4.2",
    "uberscore": "0.0.19",
    "underscore.string": "^3.3.5",
    "urequire": "0.7.0-beta.33",
    "urequire-ab-specrunner": "^0.2.5",
    "urequire-rc-inject-version": "^0.1.6"
    }
    }


    Já exclui o yarn.lock e dei o comando yarn install e o erro ainda persiste

    Utilizei o yarn add upath, exclui o yarn.lock e usei o yarn install novamente, o erro continua aparecendo assim: [​IMG]

    conteudo do arquivo upath.js citado no erro:

    /**
    * upath http://github.com/anodynos/upath/
    *
    * A proxy to `path`, replacing `\` with `/` for all results (supports UNC paths) & new methods to normalize & join keeping leading `./` and add, change, default, trim file extensions.
    * Version 2.0.1 - Compiled on 2020-11-07 16:59:47
    * Repository git://github.com/anodynos/upath
    * Copyright(c) 2020 Angelos Pikoulas <agelos.pikoulas@gmail.com>
    * License MIT
    */

    // Generated by uRequire v0.7.0-beta.33 target: 'lib' template: 'nodejs'


    var VERSION = '2.0.1'; // injected by urequire-rc-inject-version

    var extraFn, extraFunctions, isFunction, isString, isValidExt, name, path, propName, propValue, toUnix, upath, slice = [].slice, indexOf = [].indexOf || function (item) {
    for (var i = 0, l = this.length; i < l; i++) {
    if (i in this && this === item)
    return i;
    }
    return -1;
    }, hasProp = {}.hasOwnProperty;
    path = require("path");
    isFunction = function (val) {
    return typeof val === "function";
    };
    isString = function (val) {
    return typeof val === "string" || !!val && typeof val === "object" && Object.prototype.toString.call(val) === "[object String]";
    };
    upath = exports;
    upath.VERSION = typeof VERSION !== "undefined" && VERSION !== null ? VERSION : "NO-VERSION";
    toUnix = function (p) {
    p = p.replace(/\\/g, "/");
    p = p.replace(/(?<!^)\/+/g, "/");
    return p;
    };
    for (propName in path) {
    propValue = path[propName];
    if (isFunction(propValue)) {
    upath[propName] = function (propName) {
    return function () {
    var args, result;
    args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
    args = args.map(function (p) {
    if (isString(p)) {
    return toUnix(p);
    } else {
    return p;
    }
    });
    result = path[propName].apply(path, args);
    if (isString(result)) {
    return toUnix(result);
    } else {
    return result;
    }
    };
    }(propName);
    } else {
    upath[propName] = propValue;
    }
    }
    upath.sep = "/";
    extraFunctions = {
    toUnix: toUnix,
    normalizeSafe: function (p) {
    var result;
    p = toUnix(p);
    result = upath.normalize(p);
    if (p.startsWith("./") && !result.startsWith("./") && !result.startsWith("..")) {
    result = "./" + result;
    } else if (p.startsWith("//") && !result.startsWith("//")) {
    if (p.startsWith("//./")) {
    result = "//." + result;
    } else {
    result = "/" + result;
    }
    }
    return result;
    },
    normalizeTrim: function (p) {
    p = upath.normalizeSafe(p);
    if (p.endsWith("/")) {
    return p.slice(0, +(p.length - 2) + 1 || 9000000000);
    } else {
    return p;
    }
    },
    joinSafe: function () {
    var p, p0, result;
    p = 1 <= arguments.length ? slice.call(arguments, 0) : [];
    result = upath.join.apply(null, p);
    if (p.length > 0) {
    p0 = toUnix(p[0]);
    if (p0.startsWith("./") && !result.startsWith("./") && !result.startsWith("..")) {
    result = "./" + result;
    } else if (p0.startsWith("//") && !result.startsWith("//")) {
    if (p0.startsWith("//./")) {
    result = "//." + result;
    } else {
    result = "/" + result;
    }
    }
    }
    return result;
    },
    addExt: function (file, ext) {
    if (!ext) {
    return file;
    } else {
    if (ext[0] !== ".") {
    ext = "." + ext;
    }
    return file + (file.endsWith(ext) ? "" : ext);
    }
    },
    trimExt: function (filename, ignoreExts, maxSize) {
    var oldExt;
    if (maxSize == null) {
    maxSize = 7;
    }
    oldExt = upath.extname(filename);
    if (isValidExt(oldExt, ignoreExts, maxSize)) {
    return filename.slice(0, +(filename.length - oldExt.length - 1) + 1 || 9000000000);
    } else {
    return filename;
    }
    },
    removeExt: function (filename, ext) {
    if (!ext) {
    return filename;
    } else {
    ext = ext[0] === "." ? ext : "." + ext;
    if (upath.extname(filename) === ext) {
    return upath.trimExt(filename, [], ext.length);
    } else {
    return filename;
    }
    }
    },
    changeExt: function (filename, ext, ignoreExts, maxSize) {
    if (maxSize == null) {
    maxSize = 7;
    }
    return upath.trimExt(filename, ignoreExts, maxSize) + (!ext ? "" : ext[0] === "." ? ext : "." + ext);
    },
    defaultExt: function (filename, ext, ignoreExts, maxSize) {
    var oldExt;
    if (maxSize == null) {
    maxSize = 7;
    }
    oldExt = upath.extname(filename);
    if (isValidExt(oldExt, ignoreExts, maxSize)) {
    return filename;
    } else {
    return upath.addExt(filename, ext);
    }
    }
    };
    isValidExt = function (ext, ignoreExts, maxSize) {
    if (ignoreExts == null) {
    ignoreExts = [];
    }
    return ext && ext.length <= maxSize && indexOf.call(ignoreExts.map(function (e) {
    return (e && e[0] !== "." ? "." : "") + e;
    }), ext) < 0;
    };
    for (name in extraFunctions) {
    if (!hasProp.call(extraFunctions, name))
    continue;
    extraFn = extraFunctions[name];
    if (upath[name] !== void 0) {
    throw new Error("path." + name + " already exists.");
    } else {
    upath[name] = extraFn;
    }
    }

    ;

    Continue reading...

Compartilhe esta Página