Tag: macos

Mac OS X上的ElasticSearch + Node Yosemite:JRE崩溃?

这一点有些莫名其妙,可能是因为我没有经常遇到JRE核心转储。 我正在为Node.js使用官方的ElasticSearch模块,并试图在我的一个索引中创build一个新的文档。 我的节点应用程序似乎连接到ES实例就好了,但是当我执行create请求时,我的JRE咬了灰尘! 这里是节点吐出的错误: Elasticsearch INFO: 2015-12-16T21:40:47Z Adding connection to http://my.server.address/:9200 Elasticsearch DEBUG: 2015-12-16T21:40:53Z starting request { method: 'POST', path: '/test/document', body: { foo: 'bar' }, query: { op_type: 'create' } } # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00000001004f3616, pid=40975, tid=1299 # # […]

node.js中的execSync不能正确运行shell命令

我试图在node.js中运行一个child_process.execSync shell命令,如下所示: function test() { return new Promise(function(resolve, reject) { var execSync = require('child_process').execSync; var result = execSync('some executable I manually installed', { encoding: 'utf8', silent: true }); if (result.search('something') > -1) { resolve("ok"); } else if (result.search('something else') { resolve("nok"); } else { reject(Error("ERROR")); } }); } test().then(function(result) { console.log(result); }, function(err) { console.log(err); […]

GithubElectron:在浏览器进程中发生JavaScript错误

我用npm安装了“electron-packager”并执行了命令 electron-packager . Johnston –platform=darwin –arch=x64 –version=0.36.0 然后当我运行“Johnston.app”时,出现这个错误(我甚至没有看到主窗口) 未捕获exception:错误:在Module.require(module.js:282:25)的Function.Module._load(module.js:282:25)处的Function.Module._resolveFilename(module.js:332:15) 361:17)在要求(module.js:380:17)在对象。 (/Users/David/Github/Johnston/Johnston-darwin-x64/Johnston.app/Contents/Resources/app/main.js:3:18)在Module._compile(module.js:426:26)在对象。在Module.load(module.js:351:32)上的Function.Module._load(module.js:306:12)上的Module._extensions.js(module.js:444:10)。 (/Users/David/Github/Johnston/Johnston-darwin-x64/Johnston.app/Contents/Resources/atom.asar/browser/lib/init.js:104:10) 有没有解决办法? 谢谢!

尝试在全局OSX上安装ESlint时出现“权限被拒绝”

这是我想要在我的Mac上做的: npm install eslint -g 我得到一个EACCES: permission denied ,具体如下: npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'unlink', npm ERR! path: '/HOME/.node_modules_global/lib/node_modules/eslint/LICENSE' } 如何在不使用sudo情况下全局安装ESlint? 或者我应该使用sudo ?

使用nodejs上的mtp连接从设备读取/复制文件

我使用nodejs mtp模块https://github.com/panuhorsmalahti/mtp来获取文件。 但我找不到将文件复制到本地磁盘的方法。 我使用OSX。 谢谢!

无法让Yeoman正常工作

我无法让Yeoman设置为我的生活工作。 当我尝试运行以下内容时: Aidans-MacBook-Pro:~ aidan$ npm install –global yo bower grunt-cli 但是,我最终得到以下(当我试图检查版本,只有Yeoman似乎被安装): npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm npm WARN checkPermissions Missing write access to /Users/aidan/.npm-packages/lib/node_modules/bower – minimatch@3.0.0 node_modules/yo/node_modules/glob/node_modules/minimatch – lru-cache@2.7.3 node_modules/yo/node_modules/minimatch/node_modules/lru-cache – sigmund@1.0.1 node_modules/yo/node_modules/sigmund /Users/aidan/.npm-packages/lib ├── bower@1.7.7 ├── grunt-cli@0.1.13 └─┬ […]

找不到节点http服务器 – http:命令

在我的OSX上安装了http服务器之后,我得到了上面提到的错误 npm install http-server -g 它安装在 /usr/local/bin/http-server -> /usr/local/lib/node_modules/http-server/bin/http-server /usr/local/bin/hs -> /usr/local/lib/node_modules/http-server/bin/http-server /usr/local/lib 我尝试添加一条path,因为我在这里看到这个build议 PATH=$PATH:/usr/local/lib/node_modules/http-server

无法连接到scassandra(残桩cassandra)使用datastax驱动程序

我有麻烦连接到cassandra。 我试图连接到s-cassandra(这是一个残桩cassandra可以在这里审查),一个datastax node.js cassandra驱动程序 。 由于某些原因,将“127.0.0.1:8042”作为接触点传递给驱动程序会导致DriverInternalError : (强硬有时它确实随机工作,我还没有弄清楚为什么有时候会这样做,有时我不会..) DriverInternalError我得到: {“name”:“DriverInternalError”, “stack”:“…”, “消息”:“本地数据中心无法确定”, “info”:“代表驱动程序或Cassandra主机中的错误。” } 这就是我从Cassandra Driver日志中看到的: log event: info — Adding host 127.0.0.1:8042 log event: info — Getting first connection log event: info — Connecting to 127.0.0.1:8042 log event: verbose — Socket connected to 127.0.0.1:8042 log event: info — Trying to use protocol version 4 […]

在Mac上安装remotebuild失败,“uid必须是一个unsigned int”

我试图在我的Mac上安装remotebuild,在我的Mac上通过Visual Studio 2015部署Cordova应用程序。 技术信息:macOS Sierra节点v4.6.0 npm v3.10.8 xcode 8 但它失败,出现以下错误:“uid必须是一个无符号的整数” 我试图重新安装npm没有成功。 $ sudo npm install -g remotebuild npm WARN deprecated wrench@1.5.9: wrench.js is deprecated! You should check out fs-extra (https://github.com/jprichardson/node-fs-extra) for any operations you were using wrench for. Thanks for all the usage over the years. npm ERR! Darwin 16.0.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" […]

Npm恢复sudo权限为默认?

我跟着这篇文章https://docs.npmjs.com/getting-started/fixing-npm-permissions (第二选项在页面)能够安装全球模块,而不必使用sudo 它的工作原理,但现在我想恢复使用sudo权限,你有任何的build议或线索? 我必须卸载节点和NPM? 我在Mac OSX上感谢您的帮助。