尝试使用此 smartsheet api:http://smartsheet-platform.github.io/api-docs/?javascript#node.js-sample-code
它告诉我为 nodejs 做这个:
var client = require('smartsheet');
var smartsheet = client.createClient({accessToken:'ACCESSTOKEN'});
所以我在我的 main.js 文件中执行此操作,但出现错误:Uncaught ReferenceError: require is not defined
我认为这是因为我是 nodejs/npm 的新手,但我无法在实际放置此 require 函数的任何地方找到它。我想我需要弄乱我的 node.js 文件,但我完全确定。非常感谢任何指向文档或建议的链接!
最佳答案
尝试从 package.json 中删除 "type": "module"
关于javascript - 要求未定义nodejs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38343751/