我最近使用 Typescript 创建了一个名为 jkanime 的 api。在平台上发布后出现问题npm
,使用API函数时显示错误。
该错误来自我用来创建 jkanime API 的一些包的导入。
在这里我留下 api 存储库,如果有人想帮助我如何正确地将包上传到 npm 平台。https://github.com/ChrisMichaelPerezSantiago/jkanime
var jkanime = require("jkanime");
jkanime.lastAnimesAdded()
.then(doc => console.log(doc));
错误
import * as cheerio from 'cheerio';
^
SyntaxError: Unexpected token *
at Module._compile (internal/modules/cjs/loader.js:721:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (C:\Users\c\Desktop\jkanime\test\index.js:1:13)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test@1.0.0 start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the test@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\c\AppData\Roaming\npm-cache\_logs\2019-08-16T01_07_55_949Z-debug.log
RunKit 链接: https://npm.runkit.com/jkanime