SBoudrias / Inquirer.js

A collection of common interactive command line user interfaces.
MIT License
20.24k stars 1.31k forks source link

error TS2305: Module '"readline"' has no exported member 'Interface'. #959

Closed quantrpeter closed 3 years ago

quantrpeter commented 4 years ago

Hi I am using typescript, i got this, any hints?

node_modules/@types/inquirer/index.d.ts:16:10 - error TS2305: Module '"readline"' has no exported member 'Interface'.

16 import { Interface as ReadlineInterface } from "readline";

    "dependencies": {
        "@pnp/common": "1.3.7",
        "@pnp/logging": "1.3.7",
        "@pnp/nodejs": "1.3.7",
        "@pnp/odata": "1.3.7",
        "@pnp/pnpjs": "1.3.7",
        "@pnp/sp": "1.3.7",
        "@types/inquirer": "^7.3.1",
        "babel-standalone": "^6.26.0",
        "bootstrap": "^4.3.1",
        "electron-tray-window": "^1.2.4",
        "jquery": "^3.4.0",
        "popper.js": "^1.15.0",
        "react": "^16.8.6",
        "react-dom": "^16.8.6",
        "readline": "^1.3.0",
        "sp-pnp-node": "2.2.0"
    },
    "devDependencies": {
        "electron": "^7.1.1",
        "electron-packager": "^14.1.0",
        "rimraf": "3.0.0",
        "tslint": "^5.16.0",
        "typescript": "^3.4.5"
    },

thanks Peter

Dave-Nandwa commented 3 years ago

Facing same issue, did you resolve this.

quantrpeter commented 3 years ago

Hi buddy, yes, resolved. see:

{
    "name": "sharepoint-tray",
    "version": "1.0.0",
    "description": "SharePoint tray icon for Mac, Linux and Windows. Fast open SharePoint web.",
    "main": "dist/index.js",
    "scripts": {
        "start_old": "electon .",
        "package": "electron-packager . sharepoint-tray --out=exe",
        "clean": "rimraf exe",
        "build": "tsc",
        "watch": "tsc -w",
        "lint": "tslint -c tslint.json -p tsconfig.json",
        "start": "npm run build && electron ./dist/index.js"
    },
    "repository": {
        "type": "git",
        "url": "https://gitlab.com/quantr/sharepoint/sharepoint-tray.git"
    },
    "keywords": [
        "SharePoint"
    ],
    "author": "Peter <peter@quantr.hk>",
    "license": "Quantr Commercial License",
    "dependencies": {
        "@pnp/common": "1.3.7",
        "@pnp/logging": "1.3.7",
        "@pnp/nodejs": "1.3.7",
        "@pnp/odata": "1.3.7",
        "@pnp/pnpjs": "1.3.7",
        "@pnp/sp": "1.3.7",
        "babel-standalone": "^6.26.0",
        "bootstrap": "^4.3.1",
        "electron-tray-window": "^1.2.4",
        "jquery": "^3.4.0",
        "popper.js": "^1.15.0",
        "react": "^16.8.6",
        "react-dom": "^16.8.6",
        "sp-pnp-node": "^3.0.1"
    },
    "devDependencies": {
        "electron": "^10.1.5",
        "electron-packager": "^15.1.0",
        "rimraf": "3.0.0",
        "tslint": "^5.16.0",
        "typescript": "^3.4.5"
    },
    "peerDependencies": {}
}
Dave-Nandwa commented 3 years ago

Mind explaining what you did to resolve the issue please, mine's a node.js app

quantrpeter commented 3 years ago
{
    "compilerOptions": {
        "module": "commonjs",
        "noImplicitAny": true,
        "sourceMap": true,
        "outDir": "dist",
        "baseUrl": ".",
        "paths": {
            "*": [
                "node_modules/*"
            ]
        },
        "lib": [
            "dom",
            "es6"
        ],
        "noImplicitAny": false,
        "skipLibCheck": true
    },
    "include": [
        "src/**/*"
    ]
}

these:

    "noImplicitAny": false,
    "skipLibCheck": true
Dave-Nandwa commented 3 years ago

Thanks!