jjzjj

module_platform_driver

全部标签

javascript - react : Flow: Import a local js file - cannot resolve issue module

我正在使用Flow:Statictypecheckinglibrary对于React前端应用程序,它会为从src目录的内部导入抛出“无法解析”:Exampleinfileatpath:src/abc/def/ghi/hello.jsx,Iamusingthefollowingimport:importwordsfrom'../words';-->Throwserror"Cannotresolvemodule../wordswords.jsisinsrc/abc/defdir已编辑:安装flow-typed后,我的.flowconfig看起来像这样:[ignore].*/node_mod

javascript - 错误 : "Could not find a declaration file for module ' react-search-input'"

我正在尝试安装react-input-search。我有错误:Couldnotfindadeclarationfileformodule'react-search-input'.'.../app/node_modules/react-search-input/lib/index.js'implicitlyhasan'any'type.Trynpminstall@types/react-search-inputifitexistsoraddanewdeclaration(.d.ts)filecontainingdeclaremodule'react-search-input';ts(70

javascript node module.exports/require() 前端代码

我一直在研究使用像SVGO这样的库能够在前端清理用户提交的SVG代码。SVGO是一个基于node.js的库,通常在后端运行,所以我一直在努力思考如何将SVG代码从前端发送到后端,然后将清理过的代码反刍到前端。正是在我试图弄清楚这一点的时候,我检查了他们的webappexample,经检查,在链接脚本中运行代码,我通常会在前端的后端看到这些代码。特别是,它们的许多函数都具有签名(fullscript):1:[function(require,module,exports){"usestrict";varloadScripts=require("./load-scripts"),...mo

javascript - TS1148 ~ 如何使用 --module : "import" and typescript 2. x "none"

我目前正在使用一些旧版JavaScript开发一个项目。该应用程序不包含模块加载器,它只是将所有内容作为全局变量放入window对象中。遗憾的是,接触遗留代码并包含模块加载器对我来说不是一个可行的选择。我想在我自己的代码中使用typescript。我设置了typescript编译器选项module:"none"在我的tsconfig.json中,我只使用命名空间来组织我自己的代码。到目前为止效果很好。..到现在为止:import*asRxfrom'rxjs';..Rx.Observable.from(['foo',bar']);...//ResultsinTypeScript-Erro

javascript - import {module} 和 import module 的区别

这个问题在这里已经有了答案:`exportconst`vs.`exportdefault`inES6(6个答案)usingbracketswithjavascriptimportsyntax(2个答案)WhenshouldIusecurlybracesforES6import?(11个答案)关闭5年前。我看到了以下两种从ES6中的另一个模块导入代码的变体:import{module}from"./Module"和importmodulefrom"./Module"其中module是文件中定义的ES6类Module.js这两个导入语句有什么区别?

javascript - Angular : Mixing provider and custom service in module's config/run

我想做这样的事情:angular.module('app',[]).config(['$httpProvider','customAuthService',($httpProvider,customAuthService)->$httpProvider.defaults.transformRequest.push(data)->ifcustomAuthService.isLoggedIndata['api_key']={token:@token}])根据Angularjsdoc,我不能在我的module的configblock中执行此操作,因为那里不允许自定义服务,我也不能在run中执

javascript - es6-module 默认导出导入为未定义

我不确定我在这里遗漏了什么。我正在使用jspm和es6-module-loader开发一个项目。我有一个定义如下的模块:importhooksfrom'./hooks';importapifrom'./api';importtoolsfrom'./tools';constStencilUtils={hooks:hooks,api:api,tools:tools,};export{hooks,api,tools};exportdefaultStencilUtils;/*globaldefine*/(function(root){if(typeofdefine==='function'&&

javascript - 错误 : "Cannot find module" while running firebase cloud function

constfunctions=require('firebase-functions');varnodemailer=require('nodemailer');//constexpress=require('express');vartransporter=nodemailer.createTransport('smtps://username@gmail.com:password5@smtp.gmail.com');exports.sendMail=functions.https.onRequest((req,res)=>{varmailOptions={to:'receiver@

javascript - 运行 Gulp 会抛出错误 "Cannot find module ' ./lib/_stream_writable.js'”

我正在构建一个关于Root'sSageWordPressTheme的主题.设置并运行必要的命令后。每当我运行Gulp时,它都会抛出以下错误module.js:338throwerr;^Error:Cannotfindmodule'./lib/_stream_writable.js'atFunction.Module._resolveFilename(module.js:336:15)atFunction.Module._load(module.js:278:25)atModule.require(module.js:365:17)atrequire(module.js:384:17)a

javascript - Node module.exports 返回未定义

我遇到了Node.js和module.exports的问题。我知道module.exports是一个返回对象的调用,该对象具有分配给它的任何属性。如果我有这样的文件结构://formatting.jsfunctionFormat(text){this.text=text;}module.exports=Format;用这个://index.jsvarformatting=require('./formatting');有没有办法初始化一个Format对象并像这样使用它?formatting('foo');console.log(formatting.text);每当我尝试这样做时,我都