草庐IT

find_module

全部标签

javascript - 引用错误 : Can't find variable: require at

我有一个关于将jasmine与Grunt一起使用的问题。我一直收到错误,ReferenceError:找不到变量:requireat每当我运行jasmine测试时。这是我的Gruntfile.js的jasmine条目:jasmine:{js:{src:jsFiles,options:{specs:'tests/*_spec.js',helpers:'tests/helpers/*',vendor:'vendor/*'}}},我可以在没有require的情况下运行虚拟测试,但当我在测试中包含require时,就像这样,我会收到require错误。vartestD=require('../

javascript - 更新 : How to find event listeners on a DOM node in prototype?

我正在寻找thisquestion的更新答案.在Prototype1.6+中似乎不再使用Event.observers(可能是为了避免内存泄漏),那么我现在如何追踪哪些事件监听器附加到一个元素?我知道Firebug有一个“breakonnext”按钮,但是在我可以在另一个特定元素上达到我想要的行为之前,body元素上有几个鼠标监听器执行,那么还有其他方法吗? 最佳答案 我已经更新了答案youlinkedto具有更全面的Prototype覆盖范围,涵盖1.6.0到1.6.1版本的变化。中间变得非常困惑,但是1.6.1比较干净:varh

javascript - Webpack 2 - babel-loader - 如何排除 node_modules?

自从我升级到Webpack2后,我的“规则”中不能有“排除”。也无法将“排除”传递给“选项”。现在正确的做法是什么?之前:{test:/\.js$/,loader:'babel-loader',exclude:/node_modules/,}现在:{test:/\.js$/,use:[{loader:'babel-loader'}]???}整个配置:constpath=require('path');//constautoprefixer=require('autoprefixer');constpostcssImport=require('postcss-import');const

javascript - 在 jQuery.find() 中跳过选择器的递归?

TL;DR:如何获得类似find()的操作,但会阻止某个选择器的遍历(不是句号,只是跳过)?答案:$(Any).find(Selector).not($(Any).find(Mask).find(Selector))Thereweremanytrulygreatanswers,IwishIcouldsomehowdistributethebountypointsmore,maybeIshouldmakesome50ptbountiesinresponsetosomeofthese;pIchooseKarl-AndréGagnon'sbecausethisanswermanagedtom

javascript - Gulp with browserify : Cannot find module src/js/main. js

我正在尝试使用Gulp和browserify进行基本build设置,但在尝试运行默认任务时不断看到此错误:Error:Cannotfindmodule'src/js/main.js'from'/Users/ben/dev/git/myapp/'gulp文件.jsvargulp=require('gulp');varbrowserify=require('browserify');vardel=require('del');varsource=require('vinyl-source-stream');varpaths={main_js:['src/js/main.js'],js:['

javascript - 错误 : Could not resolve module @angular/core

我正在尝试运行angular4应用程序,但我一直收到此错误ERRORinCouldnotresolvemodule@angular/core没有其他错误。没有任何依赖错误。@angular/core存在于node_modules文件夹中。我已经尝试安装@angular/cli并且没有但对此错误没有影响。我不确定如何解决这个问题。它出现在我的amazonec2机器上,但不出现在我的本地Mac机器上。库的版本都是一样的。任何帮助将不胜感激。谢谢。 最佳答案 如果有人仍然面临这样的问题-您的package.json可能已损坏。请按照以下步

javascript - 将 TypeScript 与外部 JS 文件捆绑在一起(例如 node_modules)

我可以成功地将我的Typescript项目捆绑在一起,并使用例如将其保存为单个文件tsc--outFile"build/bundle.js"但是,此文件仅包含Typescript文件,不包含“node_modules”目录中的任何文件,例如jQuery。如果我尝试执行bundle,我只会收到找不到文件的错误消息。如何将我的Typescript依赖的“node_modules”文件添加到同一个捆绑文件中?Typescript显然知道文件的位置,因为它的路径是正确的。我正在使用SystemJS在浏览器中加载我的项目。我承认我很困惑我应该如何加载模块和捆绑(我可以使用SystemJSbund

javascript - 无法动态转译 ES 模块 System.config({ transpile : 'transpile-module' })

这是我的tsconfig.js{"compilerOptions":{"experimentalDecorators":true,"emitDecoratorMetadata":true,"moduleResolution":"node","target":"es5","module":"system","noImplicitAny":false,"outDir":"built","rootDir":".","sourceMap":false},"exclude":["node_modules"]我正在使用tsc命令将我的“hello-angular.ts”转译为“hello-angu

javascript - 引用错误 : Can't find variable: exports

问题:为什么会出现以下错误?我是否忘记在我的html中包含脚本?ReferenceError:Can'tfindvariable:exports从导致它的typescript生成的javascript:"usestrict";Object.defineProperty(exports,"__esModule",{value:true});/*morecode*/额外:tsconfig.json{"compileOnSave":true,"compilerOptions":{"target":"es5","noImplicitAny":true,"rootDir":".","source

javascript - babel-node 无法在 node_modules 中要求 jsx 文件

我知道babel-node忽略node_modules默认情况下,所以我运行了三种不同的方式来覆盖它,但都失败了:跑了babel-nodeapp.js与.babelrc:{"presets":["es2015","react"],"only":["app","node_modules/react-components"]}结果:SyntaxError:Unexpectedtoken对于所需的jsxNode模块跑了babel-nodeapp.js与.babelrc:{"presets":["es2015","react"],"ignore":"node_modules\/(?!react