我正在编写一个 TypeScript/React Web 应用程序,它具有以下顶级目录\n结构:
\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 jest.config.ts\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 node_modules\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 package.json\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 package-lock.json\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 public\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 src\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 tsconfig.json\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 webpack.config.js\nRun Code Online (Sandbox Code Playgroud)\n所有 TypeScript 源文件都包含在该src/目录中,但我想在编译/类型检查中忽略单个文件(将来可能还会有更多文件)。
我在此文件中遇到错误,但我不想在应用程序中使用该文件。\n我也不想删除该文件,因为它是另一个应用程序使用的模块的一部分。
\nerror TS2307: Cannot find module 'x' or its corresponding type declarations.\nRun Code Online (Sandbox Code Playgroud)\n你能帮我做这个吗?这是tsconfig.json我正在使用的文件:
{\n "compilerOptions": {\n "allowJs": true,\n "emitDecoratorMetadata": true,\n "esModuleInterop": true,\n "experimentalDecorators": true,\n "forceConsistentCasingInFileNames": true,\n "jsx": "react",\n "module": "es6",\n "moduleResolution": "node",\n "outDir": "./dist",\n "rootDir": "./src",\n "skipLibCheck": true,\n "strict": true,\n "target": "es5"\n },\n "exclude": [\n "dist/",\n "jest.config.ts",\n "webpack.config.js"\n ]\n}\nRun Code Online (Sandbox Code Playgroud)\n … 我正在尝试对Vue.js应用程序进行Docker化。我正在使用node:10.15-alpineDocker映像作为基础。映像生成失败,并出现以下错误:
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:154:21)
gyp ERR! System Linux 4.9.125-linuxkit
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp …Run Code Online (Sandbox Code Playgroud) alpine-linux ×1
compilation ×1
docker ×1
node-gyp ×1
node.js ×1
npm ×1
transpiler ×1
tsc ×1
typescript ×1