首页 \ 问答 \ 使用npm和纱线的package.json脚本?(package.json scripts that work with npm and yarn?)

使用npm和纱线的package.json脚本?(package.json scripts that work with npm and yarn?)

我使用npm作为构建工具 ,所以在我的package.json ,我的一些脚本依赖于其他脚本:

{
  "test": "npm run lint && mocha"
}

这将npm包管理器硬编码到package.json 。 如何使这种表达依赖关系的方法对npmyarn都起作用?


I am using npm as a build tool and so in my package.json, and some of my scripts depend on other scripts:

{
  "test": "npm run lint && mocha"
}

This hardcodes the npm package manager into package.json. How can make this approach to expressing dependencies work with both npm and yarn?


原文:https://stackoverflow.com/questions/41647961
更新时间:2022-02-02 09:02

最满意答案

您似乎已安装Microsoft ASP.NET Web优化框架( 1.1.0 Alpha11.1.0 Beta1 )的预览版本。 目前,Bundle Transformer仅支持RTM版本的Microsoft ASP.NET Web Optimization Framework(版本1.0.0 )。 我建议您回滚到RTM版本。


It seems that you have installed preview version of the Microsoft ASP.NET Web Optimization Framework (1.1.0 Alpha1 or 1.1.0 Beta1). At the moment, the Bundle Transformer supports only RTM-version of the Microsoft ASP.NET Web Optimization Framework (version 1.0.0). I recommend that you roll back to RTM-version.

相关问答

更多
  • 断言仅用于调试,并允许您检查单行中的不变量。 断言和类似的宏在测试框架中普遍使用。 除了例外,您真的需要关心您的库或程序的其余部分正在做什么。 断言很简单。 它会使程序崩溃,而不会导致它产生什么 - 你的断言引起了它。 在调试器中更容易去那里。 可能会捕获异常并且不会停止程序,或者可能会导致副作用,例如从通常不会发生的地方进行堆栈展开,调用所有析构函数等,当您不关心它时因为你正在调试。 除了异常,您需要声明要抛出的函数,必须在C ++等语言中启用异常。 如果您正在以交互方式调试而不仅仅是以批处理模式运行测试 ...
  • 这些不同的异常可以使流程更容易,因为您可以同时捕获多种类型的异常。 看看这个: function mustBeEqual($a, $b){ if($a < $b){ throw new aIsSmallerThanBException()('a is smaller than b'); }elseif($a > $b){ throw new aIsLargerThanBException()('a is larger than b'); } else { //Everyt ...
  • 您似乎已安装Microsoft ASP.NET Web优化框架( 1.1.0 Alpha1或1.1.0 Beta1 )的预览版本。 目前,Bundle Transformer仅支持RTM版本的Microsoft ASP.NET Web Optimization Framework(版本1.0.0 )。 我建议您回滚到RTM版本。 It seems that you have installed preview version of the Microsoft ASP.NET Web Optimization ...
  • 您的代码不可执行,请在下次提供MCVE或至少提供完整版面 。 你甚至不提供建议的签名。 这不是针对SO提出问题的好方法。 作为拥有1,000多个声望点的用户,您应该知道这一点。 无论如何,你的问题的答案其实很简单。 假设你有这个示例代码: 异常类+驱动应用程序: package de.scrum_master.app; public class MySpecificException extends Exception { private static final long serialVersion ...
  • 你第一次抛出异常。 throw new Exception(); 你重新抛出一个被捕获的异常 } catch (Exception e) { // do something throw e; } 通过抛出一个包含该异常的不同异常来包装异常。 } catch (Exception e) { // do something throw new Exception(e); } You throw an exception the first time. throw new Excep ...
  • 首先, Exception是每个Exception的基类型。 就像object是为了一切。 通过抛出一个特定的Exception您可以向消费者提供更多信息。 想象一下如果你没有消息就会得到一个简单的Exception ,消费者就会失去。 例如,当框架抛出一个NullReferenceException ,你意识到一个事实,即你的一个对象没有一个它试图访问的引用。 这就是你如何链接异常并使用它们的类型: try { throw new NotImplementedException(); } catch ...
  • 你可以捕捉到这个例外: doThrow(new MyException()).when(myMock).myMethod(); try { myMock.myMethod(); fail("MyException should have been thrown!"); } catch (MyException expected) { // Do something } System.out.println("Here"); // Verify the mock, assert, ...
  • 这里可能有用的一种方法是改变调用您明确允许失败的代码的方式,使其看起来根本不像try / catch块。 例如,您可以编写一个执行错误报告的辅助方法,并使用表示为lambdas的操作来调用它: void InvokeFailSafe(Action action, Action onFailure = null) { try { action(); } catch (Exception e) { if (onFailure != null) ...
  • 看看这个条件: if (inps.charAt(i) != ' ' || inps.charAt(i) != '\t') 如果角色不是空格或者不是制表符,那将会通过。 单个字符不能同时包含空格和制表符,因此至少有一个子条件为真。 你想要&& - 虽然我提取对charAt的调用: char c = inps.charAt(i); if (...) ... else if (c != ' ' && c != '\t') ...或者我只是使用switch语句,这将更清晰IMO: switch (inps.ch ...
  • 从概念的角度来看,这是一个很好的方法; 你的对象最适合知道什么是有效输入,而不是你对象的调用者。 但是,显然你的逻辑并不完整; 有一些重大的“极端案例”,如2月31日。 这也是一个重复的工作。 接受Year,Month和Day的DateTime构造函数将验证这些数字的组合是否产生有效日期,如果不是,则将抛出自己的ArgumentOutOfRange异常。 验证更完整; 它不仅会验证每个月的正确天数,还会进行闰年计算,以确定2月29日是否对指定年份有效。 最重要的是, 它已经存在 ; 正如Equalsk在评论 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)