草庐IT

coffee-script-source

全部标签

javascript - 你如何运行多个 grunt scripts.postinstall?

我正在尝试从grunt的scripts.postinstall运行多个CLI命令。我不知道如何让两者都运行。如果我添加第二个命令都不会运行。它们分别在安装后和控制台中工作。我已经尝试将它们包装在一个数组中:"scripts":{"postinstall":["node_modules/.bin/bowerinstall","gruntsetup"]},我尝试用分号分隔它们:"scripts":{"postinstall":"node_modules/.bin/bowerinstall;gruntsetup"},我似乎在NPMScripts上找不到解决方案这些部分的gruntfile.j

node.js - 我可以直接从 node.js 运行 .coffee 文件吗?

我正在做一些教程,我正在用CoffeeScript编写所有内容。然后我必须编译为JS,然后在node.js中执行。有什么办法可以直接做吗? 最佳答案 是的,你可以。coffeesource.coffee-n它将直接运行Node而不生成任何.js文件。Reference更新:Coffee现在也支持--nodejs。以上与coffeesource.coffee--nodejs但是是的,-n要短得多。 关于node.js-我可以直接从node.js运行.coffee文件吗?,我们在StackO

javascript - grunt 找不到模块 'coffee-script'

我使用以下命令安装平均堆栈并创建应用程序:>sudonpminstall-gmeanio@latest//Getthemeancmdline>meaninitmyApp//createyourfirstapp>cdmyApp&&npminstall//Installdependencies>grunt//Launchmean但是当我到达最后的grunt命令时,我得到了错误:module.js:333throwerr;^Error:Cannotfindmodule'coffee-script'atFunction.Module._resolveFilename(module.js:331

node.js - npm "scripts": "start" run express and open url

我在package.json中有这个启动参数"scripts":{"start":"nodebin/www"},当我输入npmstart时,它正在运行我的express应用程序。但我希望浏览器同时打开http://localhost:8081。我怎么能对start说也打开我的本地url?like:"start":"nodebin/www,http://localhost:8081"所以当我输入npmsatrt时,它会运行我的快速应用程序并同时打开网址。 最佳答案 据我所知,这就像写一个bash命令://Windows"start":

javascript - 找不到模块 'coffee-script'

尝试使用TowerJS设置一个基本站点作为测试,但在运行脚手架生成器时遇到此错误。Macbook:appjohn$towergeneratescaffoldPosttitle:stringbody:textbelongsTo:user{[Error:Cannotfindmodule'coffee-script']code:'MODULE_NOT_FOUND'}module.js:340throwerr;^Error:Cannotfindmodule'/Users/john/Sites/tower/app/app/config/shared/application'atFunction.

javascript - 'react-scripts' 未被识别为内部或外部命令

我有一个maven项目,其中的JavaScript项目被克隆为一个git子模块。所以目录结构看起来像mavenapp/src/main/javascript/[npmprojectfiles]在我的package.json中,测试如下所示:"test":"react-scriptstest--env=jsdom",但是当我尝试运行npmtest时,它说'react-scripts'isnotrecognizedasaninternalorexternalcommand,有趣的是,当我独立克隆javascript项目时,我没有收到此错误。我试过重新运行npminstall。NPM版本:5

node.js - Node/ express : set NODE_ENV when using Forever to run script continuously

如何设置NODE_ENV当我使用forever时将变量/参数设置为“生产”启动我的Node脚本到目前为止我得到了这个:foreverstart-lforever.log-oout.log-eerr.log-aapp.js 最佳答案 你可以正常设置NODE_ENV然后永远运行:NODE_ENV=productionforever[flags]startapp.js[app_flags]当服务器重新启动时,初始的NODE_ENV将被保留-此问题中已修复的行为:https://github.com/nodejitsu/forever/is

node.js - 弃用警告 : Buffer() is deprecated due to security and usability issues when I move my script to another server

脚本移动到其他服务器时出错。(node:15707)[DEP0005]DeprecationWarning:Buffer()isdeprecatedduetosecurityandusabilityissues.PleaseusetheBuffer.alloc(),Buffer.allocUnsafe(),orBuffer.from()methodsinstead.当前版本:Ubuntu16.04.4LTSNode-v10.9.0NPM-6.2.0以前的版本:Ubuntu14.04.3LTSNPM-3.10.10Node-v6.10.3exports.basicAuthenticati

node.js - 如何修复 'fs: re-evaluating native module sources is not supported' - 优雅的 fs

最近我切换到Nodev.6,它开始在运行正常构建grunt/gulp/webpack时产生越来越多的问题例如:$gulp[14:02:20]Localgulpnotfoundin~/_Other/angular-2-ts/angular2-seed[14:02:20]Tryrunning:npminstallgulp在/node_modules文件夹中安装gulp和所有其他插件和模块(甚至通过rm-rfnode_modules重新安装)。大多数错误都有类似的行(node:42)fs:re-evaluatingnativemodulesourcesisnotsupported.Ifyou

powershell - 类型 "bind": bind source path does not exist when trying to run container on Docker for Windows 的安装配置无效

我正在尝试在https://docs.docker.com/engine/admin/prometheus/#use-prometheus上运行Prometheus示例在Windows上使用Docker。我正在执行以下命令:dockerservicecreate--replicas1--namemy-prometheus`--mounttype=bind,source="C:/temp/prometheus.yml",destination=/etc/prometheus/prometheus.yml`--publishpublished=9090,target=9090,protoc