javascript - 我不断收到以下错误:“错误:找不到模块'./framer'”
问题描述
我一直遇到同样的问题。我正在为理发店制作一个网站,我正在尝试使用 google api 将事件添加到 google 日历中。我安装了googleapis和framer,但是一直说找不到framer模块。我什至卸载了framer并重新安装了它,它仍然无法正常工作。当我使用以下代码时出现错误:
const {google} = require('googleapis');
错误信息:
Uncaught Error: Cannot find module './framer'
at webpackEmptyContext (protocol sync:2)
at Array.map (<anonymous>)
at Object../node_modules/http2/lib/protocol/index.js (index.js:46)
at __webpack_require__ (bootstrap:856)
at fn (bootstrap:150)
at Object.<anonymous> (http.js:136)
at Object../node_modules/http2/lib/http.js (http.js:1262)
at __webpack_require__ (bootstrap:856)
at fn (bootstrap:150)
at Object../node_modules/http2/lib/index.js (index.js:18)
at __webpack_require__ (bootstrap:856)
at fn (bootstrap:150)
at Object.<anonymous> (http2.js:16)
at Object../node_modules/googleapis-common/build/src/http2.js (http2.js:249)
at __webpack_require__ (bootstrap:856)
at fn (bootstrap:150)
at Object.<anonymous> (apirequest.js:23)
at Object../node_modules/googleapis-common/build/src/apirequest.js (apirequest.js:304)
at __webpack_require__ (bootstrap:856)
at fn (bootstrap:150)
at Object../node_modules/googleapis-common/build/src/index.js (index.js:24)
at __webpack_require__ (bootstrap:856)
at fn (bootstrap:150)
at Object../node_modules/googleapis/build/src/apis/abusiveexperiencereport/index.js (index.js:17)
at __webpack_require__ (bootstrap:856)
at fn (bootstrap:150)
at Object../node_modules/googleapis/build/src/apis/index.js (index.js:17)
at __webpack_require__ (bootstrap:856)
at fn (bootstrap:150)
at Object../node_modules/googleapis/build/src/googleapis.js (googleapis.js:16)
at __webpack_require__ (bootstrap:856)
at fn (bootstrap:150)
at Object../node_modules/googleapis/build/src/index.js (index.js:17)
at __webpack_require__ (bootstrap:856)
at fn (bootstrap:150)
at Module.<anonymous> (timePicker.js:3)
at Module../src/components/calendar/timePicker.js (timePicker.js:158)
at __webpack_require__ (bootstrap:856)
at fn (bootstrap:150)
at Module.<anonymous> (Navbar.js:68)
at Module../src/components/Appointment.js (Appointment.js:120)
at __webpack_require__ (bootstrap:856)
at fn (bootstrap:150)
at Module.<anonymous> (protocol sync:9)
at Module../src/App.js (App.js:42)
at __webpack_require__ (bootstrap:856)
at fn (bootstrap:150)
at Module.<anonymous> (index.css?bb0a:82)
at Module../src/index.js (index.js:18)
at __webpack_require__ (bootstrap:856)
解决方案
Bro首先要使用googleapis,您将需要一个单独的后端,这是因为framer库使用nodejs附带的文件系统模块,但react不可用。毕竟是前端库。一种解决方法是使用 REST API
推荐阅读
- c - 使用 usleep 函数时出错,因为编译器说“尽管没有在此范围内声明‘usleep’”,包括所有需要的库
- xml - 将多级 XML/JSON 数据保存到表中
- bash - Bash 脚本中的箭头键会产生奇怪的字母
- java - 在 JavaFX 中同时启用/禁用组按钮
- php - SQL query() 方法是否会以任何方式影响 Wordpress?
- reactjs - 如何使用 Selenium WebDriver 和 Java 获取元素的内部反应文本?
- android - 在代码中使用小部件后,Android 中未使用的导入指令
- sql - 将查询转换为视图
- mysql - 非常持久的 /opt/lampp/bin/mysql.server: 264: kill: 没有这样的进程。Xampp/ubuntu 16.04
- java - 如何设置“音量:-postgres”Windows 10