var sheets = google.sheets('v4');
^
TypeError: google.sheets is not a function
我正在使用这个启动教程Node.js Quickstart for Google电子表格.还有其他人也面临这个问题吗?
这是我的文件:
包.json :
"scripts": {
"generate-interfaces": "ts-node src/cli/generate-interfaces.ts",
"dist": "npm run generate-interfaces && rm -rf dist && tsc && cp -r static/ dist/ && cp -r resource/ dist/",
"prestart": "npm run generate-interfaces",
"start": "ts-node-dev --respawn --transpileOnly --no-notify ./src/index.ts",
"start:inspect": "ts-node-dev --no-deps --inspect -- ./src/index.ts",
"pretest": "npm run generate-interfaces",
"test": "jest"
}
Run Code Online (Sandbox Code Playgroud)
配置文件
{
"compilerOptions": {
"declaration": true,
"target": "es2017",
"module": "commonjs",
"esModuleInterop": true,
"outDir": "dist",
"sourceMap": true,
"skipLibCheck": true,
"typeRoots": ["node_modules/@types", "./typings", "node_modules/**/*.d.ts"],
"lib": ["esnext"]
},
"include": ["src/**/*.ts", "./typings/**/*.d.ts"],
"exclude": …Run Code Online (Sandbox Code Playgroud)