【发布时间】:2018-04-15 04:25:44
【问题描述】:
目标
在 vue-cli 项目中安装和构建 googleapis 包。
示例
https://github.com/ChaddPortwine/test-googleapis
要创建这个示例,我只是:
vue init webpack test-googleapisnpm install-
npm install googleapis --save,npm install google-auth-library --save -
npm run dev(到目前为止,好的,应用已构建并运行) - 添加行,
import googleapis from 'googleapis'到main.js -
npm run dev(ERR Child_Process)
错误
ERROR Failed to compile with 13 errors 11:16:12 AM
These dependencies were not found:
* child_process in ./node_modules/googleapis/node_modules/google-auth-library/lib/auth/googleauth.js
* fs in ./node_modules/google-p12-pem/index.js, ./node_modules/googleapis/lib/googleapis.js and 5 others
* net in ./node_modules/forever-agent/index.js, ./node_modules/tough-cookie/lib/cookie.js and 1 other
* tls in ./node_modules/forever-agent/index.js, ./node_modules/tunnel-agent/index.js
To install them, you can run: npm install --save child_process fs net tls
问题
如何使用googleapis 构建应用程序?
【问题讨论】:
标签: node.js google-api vue.js npm-install vue-cli