草庐IT

module-path

全部标签

javascript - Typescript 和 webstorm,缺少 --module 标志

在WebStorm中编辑在VisualStudio上创建的typescript项目时,会出现以下错误:Error:(1,1)TS1148:Cannotcompileexternalmodulesunlessthe'--module'flagisprovided.代码很简单:在文件Test.ts中classhelloWorld{}export=helloWorld;预先感谢您的帮助已编辑我忘了说我用的是MAC。同样在进入帖子后,在我寻求解决方案的过程中,我尝试在VisualStudioCodeforMac中编译网页,我在那里遇到了同样的问题,那个,让我意识到问题不是IDE,而是一些东西共

javascript - Angular JS 错误 : [$injector:nomod] Module 'portfolioMockupApp.services' is not available

我正在尝试使用Karma编写一些单元测试,但收到以下错误:PhantomJS1.9.8(MacOSX)错误错误:[$injector:nomod]模块“portfolioMockupApp.services”不可用!您要么拼错了模块名称,要么忘记加载它。如果注册模块,请确保将依赖项指定为第二个参数。http://errors.angularjs.org/1.3.3/$injector/nomod?p0=portfolioMockupApp.services在/Users/danielbogart/Documents/coding/work/portfolio-mockup/bower_

javascript - 如何在 FF 和 IOS 中使用 clip-path 多边形

我尝试编写一个小插件,以更有机的方式打开模式框,因此我决定为clip-path属性设置动画。现在这段代码只适用于chrome:http://codepen.io/meodai/pen/GgGzYo?editors=011看起来像firefoxdoesnotsupportpolygon()在clip-path属性中。Safari和MobileSafari也在努力解决这个问题。有没有一种类似的简单方法可以在Firefox和Safari以及MobileSafari中进行这项工作?知道如何解决这个问题吗?这是一个工作示例:var$ov=$('.overlay');$(document).on(

javascript - Webstorm IDE 和 AngularJS angular.module 未解析的方法

我正在为AngularJS项目使用WebstormIDE。我已经将AngularJS添加到库和自动完成等。工作正常。但是,WebstormIDE没有找到非常重要的函数angular.module()。我已经尝试了所有方法(重新安装等),但似乎仍然无法正常工作。有什么想法吗? 最佳答案 到目前为止,WebStormIDS没有任何进展ticket上面由@AllYouCanEat86引用,所以我不确定是否应该在不向WebStorm添加库的情况下修复它。一旦我遵循了thisanswer中给出的建议我的问题已解决,并且不再在WebStorm中

javascript - 为 Angular JS 启用 html 5 模式会抛出 JS 错误 : Failed to instantiate module due to: TypeError: Cannot read property 'html5Mode' of undefined

如何为AngularJS启用html5模式?'usestrict'varblogApp=angular.module('blogApp',['ngRoute']).config(['$routeProvider',function($routeProvider,$locationProvider){$routeProvider.when('/disclaimer',{templateUrl:'templates/disclaimer.html',controller:'DisclaimerCtrl'});$routeProvider.otherwise({redirectTo:'/'}

javascript - 如何使用 type=module 脚本中的代码

这个问题在这里已经有了答案:ES6Modules:Undefinedonclickfunctionafterimport(4个答案)关闭4年前。我不明白为什么这个微不足道的代码不起作用:index.html:ShowMessageshowImport.js:importshowMessagefrom'/show.js';functionshowImportedMessage(){showMessage();}show.js:exportdefault"WhydoIneedthis?";exportfunctionshowMessage(){alert("Hello!");}它由NPMh

javascript - 模块构建失败(来自 ./node_modules/babel-loader/lib/index.js): Error: Cannot find module 'babel-preset-react'

在尝试使用Webpack4和Babel7构建React应用程序时,我遇到了以下错误。ERRORin./src/index.jsModulebuildfailed(from./node_modules/babel-loader/lib/index.js):Error:Cannotfindmodule'babel-preset-react'from'/Users/me/Desktop/reflask'-Ifyouwanttoresolve"react",use"module:react"-Didyoumean"@babel/react"?atFunction.module.exports[

javascript - require.js 未捕获类型错误 : cannot read property '__module_path__; of undefined

所以我刚刚开始尝试掌握require.js,但它似乎不起作用。当我使用标签将其包含在我的html中时:在chrome中加载页面时出现以下错误UncaughtTypeError:Cannotreadproperty'__MODULE_PATH__'ofundefined->require.js:538在firefox中我得到一个稍微不同的错误:TypeError:parentisundefined->require.js:538不知道我怎么会导致这个问题,因为它是require.js的全新安装,我的main.js中还没有代码。提前致谢 最佳答案

javascript - 无效的配置对象 output.path 不是绝对路径

我尝试使用webpack将“.ts”编译为“.js”,但出现此错误,我该如何解决?Invalidconfigurationobject.WebpackhasbeeninitialisedusingaconfigurationobjectthatdoesnotmatchtheAPIschema.-configuration.output.path:Theprovidedvalue"./dist"isnotanabsolutepath!" 最佳答案 output.path需要一个绝对路径,但你给它一个相对路径./dist。您需要将其转换

javascript - Node JS 在 module.exports 中调用一个 "local"函数

如何在module.exports声明中从另一个函数中调用一个函数?我有MVC结构Nodejs项目和一个名为TestController.js的Controller。我想在Controller中访问方法,但是使用this关键字会出现以下错误:cannotcallmethodgetNameofundefined"usestrict"module.exports={myName:function(req,res,next){//accessingmethodwithincontrollerthis.getName(data);},getName:function(data){//code}