ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

errno -4058 - npm install cannot rebuild node_modules

Open AlGantori opened this issue 2 years ago • 0 comments

Description: npm install has been complaining about lots of vulnerabilities in my package.json I recently upgraded to node.js 18.x for some REST api experimentation against mongodb (just a TS project) I guess that broken my ionic3.x app projects which now won't build. I reverted to node.js v14.15.5 according to an SO post. But my ionic serve is still broken I tried deleting node_modules folder and recreate it either of the following fail

npm i --legacy-deps  
npm i --force 

The error initially complained about this location

npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\AXM\AppData\Local\npm-cache\_cacache\tmp\git-cloneiEYZWf\package.json'

so I did the following according to another post

md C:\npm-cache
npm config set cache C:\npm-cache

Still the same error and no node_modules created.

$ npm i --legacy-peer-deps
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\npm-cache\_cacache\tmp\git-cloneJh1opn/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\npm-cache\_cacache\tmp\git-cloneJh1opn\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\npm-cache\_logs\2022-05-13T06_03_59_853Z-debug-0.log

Here is my packages.json

{
    "name": "mumti",
    "version": "0.0.1",
    "author": "MUMTI Labs",
    "homepage": "https://mumti.org/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve",
        "watch": "ionic-app-scripts watch && beep ",
        "serve:before": "watch",
        "emulate:before": "build",
        "deploy:before": "build",
        "build:before": "build",
        "run:before": "build",
        "run:after": "beep",
        "serve:after": "beep",
        "beep": "bash.exe beep.sh",
        "beep0": "bash.exe -c \"echo -en '\\a' \" ",
        "releasePWA": "ionic cordova build browser --prod --release"
    },
    "dependencies": {
        "@angular/common": "5.0.3",
        "@angular/compiler": "5.0.3",
        "@angular/compiler-cli": "5.0.3",
        "@angular/core": "5.0.3",
        "@angular/forms": "5.0.3",
        "@angular/platform-browser": "^5.0.3",
        "@angular/platform-browser-dynamic": "5.0.3",
        "@ionic-native/android-full-screen": "^4.20.0",
        "@ionic-native/app-version": "^4.20.0",
        "@ionic-native/clipboard": "4.5.2",
        "@ionic-native/core": "4.5.2",
        "@ionic-native/document-viewer": "^4.7.0",
        "@ionic-native/file": "^4.7.0",
        "@ionic-native/file-transfer": "^4.7.0",
        "@ionic-native/in-app-browser": "4.5.2",
        "@ionic-native/social-sharing": "4.5.2",
        "@ionic-native/splash-screen": "^4.7.0",
        "@ionic-native/status-bar": "4.5.2",
        "@ionic-native/toast": "4.6.0",
        "@ionic/pro": "1.0.16",
        "@ionic/storage": "2.1.3",
        "@types/youtube": "0.0.46",
        "archiver": "^5.3.1",
        "child_process": "^1.0.2",
        "clipboard-js": "0.3.3",
        "com.verso.cordova.clipboard": "https://github.com/VersoSolutions/CordovaClipboard.git",
        "cordova-browser": "5.0.3",
        "cordova-clipboard": "~1.0.0",
        "cordova-plugin-device": "1.1.4",
        "cordova-plugin-file": "^6.0.1",
        "cordova-plugin-file-transfer": "^1.7.1",
        "cordova-plugin-fullscreen": "^1.2.0",
        "cordova-plugin-inappbrowser": "~1.7.1-dev",
        "cordova-plugin-ionic-webview": "^1.1.11",
        "cordova-plugin-splashscreen": "^4.0.3",
        "cordova-plugin-whitelist": "^1.3.3",
        "cordova-plugin-x-socialsharing": "~5.1.6",
        "cordova-plugin-x-toast": "~2.6.0",
        "cordova-sqlite-storage": "~2.0.3",
        "danielsogl-cordova-plugin-clipboard": "1.0.2",
        "ionic-angular": "3.9.2",
        "ionic-plugin-keyboard": "~2.2.1",
        "ionicons": "3.0.0",
        "node-apk": "^1.1.1",
        "rxjs": "5.5.2",
        "sw-toolbox": "3.6.0",
        "url-exist": "^3.0.0",
        "zone.js": "0.8.18"
    },
    "devDependencies": {
        "@ionic/app-scripts": "^3.2.4",
        "@types/node": "^9.4.7",
        "cordova-android": "^10.1.2",
        "cordova-plugin-apkupdater": "^4.0.0",
        "cordova-plugin-app-version": "^0.1.14",
        "tslint": "^5.10.0",
        "tslint-ionic-rules": "0.0.16",
        "typescript": "^2.8.3",
        "viewport-units-buggyfill": "0.6.2"
    },
    "cordovaPlugins": [
        "cordova-plugin-whitelist",
        "cordova-plugin-console",
        "cordova-plugin-statusbar",
        "cordova-plugin-device",
        "cordova-plugin-splashscreen",
        "ionic-plugin-keyboard",
        "cordova-plugin-x-socialsharing"
    ],
    "cordovaPlatforms": [
        {
            "platform": "android",
            "version": "",
            "locator": "android"
        },
        {
            "platform": "browser",
            "version": "",
            "locator": "browser"
        }
    ],
    "description": "UPS.ion: project",
    "config": {
        "ionic_source_map": "source-map",
        "ionic_copy": "./copy.config.js"
    },
    "cordova": {
        "plugins": {
            "cordova-sqlite-storage": {},
            "cordova-plugin-x-toast": {},
            "cordova-clipboard": {},
            "cordova-plugin-file-transfer": {},
            "cordova-plugin-file": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {},
            "cordova-plugin-device": {},
            "cordova-plugin-ionic-webview": {},
            "com.verso.cordova.clipboard": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-inappbrowser": {},
            "cordova-plugin-x-socialsharing": {},
            "cordova-plugin-fullscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-apkupdater": {},
            "cordova-plugin-app-version": {}
        },
        "platforms": [
            "browser"
        ]
    }
}

Here is ionic info ` image

Just 4 days ago I was able to build both an APK and build for the browser, now everything is broken. 🙏

AlGantori avatar May 13 '22 06:05 AlGantori