node.js,npm,vagrant,provisioningRelated issues-Collection of common programming errors
pvorb
javascript node.js foreach v8
I wanted to use for each … in with Node.js (v0.4.11).I use it like this:var conf = {index: {path: {first: “index.html”,pattern: “index/{num}.html”},template: “index.tpl”,limit: 8},feed: {path: “feed.xml”,template: “atom.tpl”,limit: 8} }for each (var index in conf) {console.log(index.path); }I get the following error:for each (var index in conf) {^^^^node.js:134throw e; // process.nextTick error, or ‘error’ event on first tick^ SyntaxError: Unexpected identifierat Module._compile (module.js:397
Raynos
jquery ajax node.js express
Having some trouble getting express to respond properly to my jquery ajax request. The actual posting is working fine, but no matter what I try I cant seem to actually get a data response from my app that I can use. At first it was just posting and hanging constantly, and like a minute later it would respond with an alert that said something like “XML Document loaded” (have no idea where it was coming from) — Anyways, now its giving meSyntaxError: Unexpected token ILLEGALat parse (native)at Inc
ArjunShankar
linux node.js debian installing
So well, I have a vserver with Debian 6.0.Now I would like to install Node.js, but none of the tutorials on the web seem to work. I have tried all of the results google gives me when I enter “install node.js on linux” I mostly failed because I had no idea how to install the dependencies (I’m new to linux btw)How to install node.js on a Debian system that was just setup (so no programs already installed on it and such)?
Tarrence
javascript node.js request promise
I’m new to promises and writing some network code using request and promise in NodeJS.I would like to remove these nested promises and chain them instead, but I’m not sure how I’d go about it/whether it is the right way to go.exports.viewFile = function(req, res) { var fileId = req.params.id; boxContentRequest(‘files/’ + fileId + ‘/content’, req.user.box.accessToken).then(function(response) {boxViewerRequest(‘documents’, {url: response.request.href}, ‘POST’).then(function(response) {boxViewerReq
Nahn
node.js mongodb express mongoose
I’m trying to sort via mongoose 3.6.20 and I am receiving some unexpected results.I have a list of companies with a name. At first I thought that maybe it was sorting in a case sensitive way. Which based on articles, I expect was true.I’m now using a virtual property to down case the sort field. However, I’m still getting unexpected results.CompanySchema.virtual(‘name_lower’).get(function(){return this.name.toLowerCase(); });and when I sortCompany.find().sort({ name_lower: 1 });I’m getting it in
tonymx227
node.js node-modules
I get an issue on my remote server with the Async module used with ExpressJS, it works in local but not on my remote server…SyntaxError: Unexpected token <at Object.parse (native)at /home/anthoc/apps/instaprint.fr/routes/index.js:62:20at fn (/home/anthoc/apps/instaprint.fr/node_modules/async/lib/async.js:582:34)at Object._onImmediate (/home/anthoc/apps/instaprint.fr/node_modules/async/lib/async.js:498:34)at processImmediate [as _immediateCallback] (timers.js:330:15)My code :async.waterfall(
user3084182
node.js http get
I have a piece of code that’s supposed to do a http get request. The program exited successfully without error, but I didn’t see any response and it didn’t even go inside the callback function! At first I thought it’s because http is asynchronous and put a large loop in the end but that didn’t work either. Does anyone know this issue? Only the first console log sendHttpRequest and 444 gets printed. I also tried the http.get but it didn’t work either.function sendHttpRequest (url, callBack) {cons
Praneeth Wanigasekera
node.js amazon-web-services amazon-ec2
I’m trying to load credentials for AWS with loadFromPath and getting an unexpected error. Hardcoding the same credentials with AWS.config.update works fine. To make sure the path and format of credentials file is correct I loaded the same with fs.readFile and it loads correctly, so there don’t seem to be any path / permissions issues. This seems super basic but I’ve been pulling my hair out trying to resolve. Thanks for your help.The error / output:Here: /home/ec2-user/.ec2/credentials.jsonGot
viebel
javascript node.js jsdom zombie.js
Trying Zombie for a few first hours and being way excited. The only (begginner’s luck?) problem is that the scripts are seemed to be loaded asynchronously (which is cool) and executed in the order they were downloaded (and not in the order they are mentioned in the “original” HTML file). I will explain:<head><script type=”text/javascript” src=”http://code.jquery.com/jquery-1.7.1.js”></script><script>alert($(‘body’))</script> </head>http://jsfiddle.net/viebel/G
Tobias Oberrauch
performance node.js npm
I wrote a package that analyzes the structure of many yeoman generators: https://github.com/tobiasoberrauch/yeoman-analyzerTherefore I have to install all generators. This solution tooks very long (12 hours). I’m not quite sure is the current solution is the best way to do this:Get the list of generator names: https://github.com/tobiasoberrauch/yeoman-analyzer/blob/master/lib/analyzer/data/generators.json Install generators to node_modules regarding a list of generator names (VERY SLOW) : https:
Tobias Oberrauch
performance node.js npm
I wrote a package that analyzes the structure of many yeoman generators: https://github.com/tobiasoberrauch/yeoman-analyzerTherefore I have to install all generators. This solution tooks very long (12 hours). I’m not quite sure is the current solution is the best way to do this:Get the list of generator names: https://github.com/tobiasoberrauch/yeoman-analyzer/blob/master/lib/analyzer/data/generators.json Install generators to node_modules regarding a list of generator names (VERY SLOW) : https:
trysis
javascript comments npm jshint uglifyjs2
Does the pound sign (#) start a comment in JavaScript? I have a website I am using with NPM and when I tried to minify the JavaScript with Grunt, Uglify threw the error:Warning: Uglification failed. Unexpected character ‘#’. Line 1 in app/min-libs/node_modules/grunt-contrib-jshint/node_modules/jshint/nod e_modules/cli/examples/cat.jsUse –force to continue.The file name being referred to seems to be from another NPM module, meaning they know what they are doing. So when I went to app/min-libs/no
fancy
javascript json node.js npm
What could be wrong here?/opt/local/lib/node/.npm/embedly/0.3.2/package/package.json:1 “name”: “embedly^node.js:134throw e; // process.nextTick error, or ‘error’ event on first tick^ 13 Apr 02:23:06 – [ERROR] SyntaxError SyntaxError: Unexpected token :package.json{ “name”: “embedly” , “version”: “0.3.2” , “description”: “Embedly client library for node” , “homepage”: “https://github.com/embedly/embedly-node” , “keywords”: [] , “author”:{ “name”: “Bob Corsaro”, “email”: “[email protected]”, “url”: “ht
Yilmazerhakan
git npm git-bash
I’m using Win 7, 64 bit.in Git Bash command when i writenpm it could return error.I uninstall/install check it. But nothing changed.I couldnt find a solution. In node command it is working.$ npmc:\Program Files\nodejs\node_modules\npm\node_modules\ansi\lib\newlines.js:2 function result = truth_table_chart_man(methodName, objectId, varargin)^ SyntaxError: Unexpected token =at Module._compile (module.js:437:25)at Object.Module._extensions..js (module.js:467:10)at Module.load (module.js:356:32)at F
ZeroGraviti
node.js cygwin npm
I am unable to install npm on cygwin. I have installed node v0.4.12 which is supposed to be the last supported version of nodejs on cygwin. Here is the error I get : curl http://npmjs.org/install.sh | sh% Total % Received % Xferd Average Speed Time Time Time CurrentDload Upload Total Spent Left Speed 100 85 0 85 0 0 344 0 –:–:– –:–:– –:–:– 904 sh: line 1: syntax error near unexpected token `newline’ sh: line 1: `<html>Moved: <a
Tekkub
windows node.js npm
I’m following the setup instructions for this mobile javascript debugger here. FYI, I’m using Windows XP SP2 32-bit. Please understand I am new to using git, node.js, and npm.Now, I’m stuck on this stepDownload the required libraries by running “npm link” in the checked-out directoryThe link here helped me a great deal with breaking down the steps from the first link. I deduced that the directory, Aardwolf, was ‘checked-out’ when I issued the git clone command. I tried running npm link on th
u123
maven npm
I have installed nodejs (npm) and npm install grunt-cli on my ubuntu box. I have found the nice maven-ant-run configuration for maven:https://gist.github.com/nadavdav/5308453but when I run mvn clean install from command-line I get:building:[echo] —————————————————[echo] — NPM INSTALL –[echo] —————————————————[exec] /usr/bin/npm: npm: line 2: syntax error near unexpected token `;'[exec] /usr/bin/npm: npm: line 2: `;(function ()
Joel
node.js npm
I’m able to build contextify 0.1.1 using node-gyp on Windows, but I don’t know how to get npm to recognize/use this version when resolving other modules’ dependencies. ‘npm install’ fails with the same (expected) ‘node-waf was unexpected at this time.’ error, despite having a build version of contextify in the local directory.Put simply: how do I tell npm to use a module I’ve built myself, instead of trying to download/build its own?
???????? ????????
node.js npm vagrant provisioning
During Vagrant Shell provision I try to install NodeJS and NPM on Debian Wheezy. Script is (from guide https://github.com/joyent/node/wiki/backports.debian.org):sudo echo “deb http://ftp.us.debian.org/debian wheezy-backports main” >> /etc/apt/sources.list sudo apt-get update sudo apt-get install -y nodejs-legacy curl https://npmjs.org/install.sh | sudo shNode sets up as a charm, but NPM installation fails:Stderr from the command:stdin: is not a tty dpkg-preconfigure: unable to re-open stdi
Peter Mortensen
mysql node.js npm visual-studio-2013
When I’m trying to install the Node.JS MySQL module trough Visual Studio 2013 npm Package Management, the installation fails due to the following errors:npm ERR! Failed to parse json npm ERR! Unexpected token How do I solve this or is there another way to do this?
noli
chef vagrant cookbook berkshelf
I’m trying to set up an asterisk server with chef using Berkshelf and Vagrant, and I’d first like to upgrade the kernel by running apt-get upgrade, and rebooting my machine.How can I trigger a reboot in the recipe, and have it pick up after the machine reboots? I have no problem with this using Fabric, but execute “reboot”the Chef provisioner in Vagrant died as the machine rebooted
Bradley
git vagrant
I have a file that runs properly on my linux machine and when I pull the repo onto my windows machine the file is intact and correct.However, when I boot my vagrant server, which has a virtual drive to my windows machine, I get a javascript error in the browser like this:Uncaught SyntaxError: Unexpected end of input When I inspect the file, the last few lines are gone and I see:????????????????????????at the end of the file.I have already gone over the ‘autocrlf’ instructions from github (https:
???????? ????????
node.js npm vagrant provisioning
During Vagrant Shell provision I try to install NodeJS and NPM on Debian Wheezy. Script is (from guide https://github.com/joyent/node/wiki/backports.debian.org):sudo echo “deb http://ftp.us.debian.org/debian wheezy-backports main” >> /etc/apt/sources.list sudo apt-get update sudo apt-get install -y nodejs-legacy curl https://npmjs.org/install.sh | sudo shNode sets up as a charm, but NPM installation fails:Stderr from the command:stdin: is not a tty dpkg-preconfigure: unable to re-open stdi
sarah
vagrant
In my ubuntu vagrant I’ve got a recipe that does apt-get update then apt-get upgrade -y. I’ve got a final recipe that reboots the machine if a restart is required. Since I’m using NFS to share my local directory, rebooting the VM makes the NFS share stop working. So then I need to issue a vagrant reload from my host. Is it possible to issue something similar to vagrant reload from within the guest, or have some other way of reloading the vagrant NFS config once the VM has been rebooted? I don’t
grafthez
java virtual-machine vagrant
When working with java/javaee usual development environment setup is to have everything locally (jdk installation, database, appserver etc). I know a lot of people in ruby/js world use virtual machines for development (mainly with vagrant). I wonder if there is an efficient way to set up similar env for java/javaee. I suspect that I can easily install database server and application server together with jdk version on such virtual machine, but what about regular development? I still need to have
jasonz
go vagrant archlinux
I run go build in the $GOPATH of my arch Vagrant box. But it prints out runtime: panic before malloc heap initializedfatal error: runtime: cannot allocate heap metadataAnd the box is 3.10.9-1-ARCH x86_64, memory 242M. Why I can’t build go files in the box? Thanks in advance.
hijarian
vagrant npm
Have a project with the following package.json file:{“name”: “requirejs-library-skeleton”,”description”: “RequireJS skeleton for modern JS libraries.”,”version”: “0.2.0”,”homepage”: “http://github.com/tkellen/requirejs-library-skeleton”,”author”: “Tyler Kellen”,”engines”: {“node”: “>=0.6.0″},”scripts”: {“test”: “grunt test”},”devDependencies”: {“grunt”: “~0.4″,”grunt-contrib-watch”: “*”,”grunt-contrib-less”: “~0.6.1″,”grunt-contrib-requirejs”: “~0.3.2″,”grunt-contrib-jasmine”: “~0.4.0”,”grunt
The Q CS or GS
ssl curl vagrant thin
I’m running a Rails app that forces SSL and uses HTTP basic authentication inside of a vagrant VM. If I try to make a curl request to the app from my host machine I getcurl -k –verbose https://[user]:[password]@localhost:3001/ * About to connect() to localhost port 3001 (#0) * Trying ::1… * Connection refused * Trying fe80::1… * Connection refused * Trying 127.0.0.1… * connected * Connected to localhost (127.0.0.1) port 3001 (#0) * SSLv3, TLS handshake, Client hello (1): * Unknown S
JulienD
puppet vagrant
How to handle data such as Mysql, web sites sources with Vagrant ?As a programmer, I like being able to easily set up environments for develop. So I created a vagrant box and provisioned it with puppet but I’m asking to myself, what about the data in the box ? What happen if I need to destroy the box and recreate it? All my data will be erased !I had some problems with a crashed VM and I don’t want to redo the same mistake, I want to have the control of my data.How do you do ? Do you use shared
Isaac
virtualbox vagrant nfs
I’m using Vagrant 1.3.4 on OS X 10.8.5 with VirtualBox and found it to be painfully slow. Several sources suggested switching to NFS shares to improve performance, but when I add the :nfs => true bit in my Vagrantfile, I get the following fatal error during vagrant up (or vagrant reload):[default] Exporting NFS shared folders… Preparing to edit /etc/exports. Administrator privileges will be required… Password: [default] Mounting NFS shared folders… /Applications/Vagrant/embedded/gems/g
Thanks
iphone cocoa-touch xcode uikit provisioning
Yesterday I testet a lot on my device. Suddenly I get this error message when I hit Build & Go in Xcode. First, it asks me if it’s ok to sign with my key. I click yes, and then that error message appears. My iPod is connected as usual, iTunes starts automatically and I close that to prevent interruptions.I tried restarting Xcode. Doesn’t help. My Apple Dev Enrollment is brand new. Any idea what the problem might be?Edit: In Window > Organizer I can see this message: Your mobile device has en
???????? ????????
node.js npm vagrant provisioning
During Vagrant Shell provision I try to install NodeJS and NPM on Debian Wheezy. Script is (from guide https://github.com/joyent/node/wiki/backports.debian.org):sudo echo “deb http://ftp.us.debian.org/debian wheezy-backports main” >> /etc/apt/sources.list sudo apt-get update sudo apt-get install -y nodejs-legacy curl https://npmjs.org/install.sh | sudo shNode sets up as a charm, but NPM installation fails:Stderr from the command:stdin: is not a tty dpkg-preconfigure: unable to re-open stdi
William Jockusch
iphone provisioning
In the provisioning portal, the “renew” button for my team provisioning profile is grayed out. And said profile is expired. How can I renew it?EDIT: I found the “automatic device provisioning” checkbox and “refresh” button in the organizer in Xcode. But when I select the team profile, check the checkbox, and push the refresh button, I get this message:An unexpected error occurred. Please try again. If the problem persists, please contact Apple Developer Support (http://developer.apple.com/su
Marton Sigmond
java osgi distributed provisioning dosgi
We are considering utilizing distributed OSGi in our enterprise environment. We would have the following setup:10 to 100 OSGi containers on many hosts offer various services. Many of these services are provided by more than one container. Some of these services may require being consistent across all containers (same version deployed).What is the proper way to manage bundles’ lifecycle (install, start, update, stop, uninstall) across all containers?Several requirements:As there may be so many co
Stefan Kendall
iphone app-store provisioning jailbreak
I have apps pending app-store submission, and I’d like to be able to test them easily sans creating any special builds or creating provisioning profiles for specific phones or ad-hoc distributions.How can I take this distribution-ready .app application and use it on jailbroken iPhones? I tried scping the file to /Applications, but on re-spring, the application doesn’t have gloss and it crashes as soon as I open it, which seems like a likely provisioning/signing issue.How can I easily deploy on j
Celada
iphone xcode certificate provisioning pkcs#12
My Mac hard disk crashed, put a new hard disk and reinstalled OS, xcode, but not able to build my app for device target since the certificate does not work any more. I could have used the p12 file but unfortunately I lost it.So, what’s next? How do I update my app which is there in app store? I need to smoke now 🙁
SeniorLee
iphone xcode ios distribution provisioning
My app crashes for some reason but I can’t figure out why. It just crashes after about 3 seconds after application is launched. The console says:Error launching remote program: failed to get the task for process 4091. The program being debugged is not being run.But it does not have problem with debug profile or developer provisioning. ( It also does not have problem with simulator. ) The crash only happens with distribution or ad-hoc provisioning in device. The debugger also works with developer
hakunin
amazon-ec2 chef provisioning
I want to setup chef server as cheaply as possible, while leaving it enough room to run without crashing. The only article I found on the subject warned that RabbitMQ would crash on a micro instance due to insufficient memory.The question is: what’s the cheapest EC2 instance that can run chef server reliably, considering that I don’t use CouchDB or RabbitMQ for anything else in my app, so would probably have to set them up exclusively for chef server on that same instance.
user273565
ios safari crash certificate provisioning
I have several apps in the iStore for iPhone/iPad. I was notified that my certificates expired. I followed the steps on https://developer.apple.com/ios/manage/certificates/team/create.action. However, Safari crashes when I submit! Has anyone experienced this?
Kara
centos virtual-machine chef provisioning
I just installed a fresh CentOS 6.3 VM and disabled SELinux. Below is the exact script that I ran to install Ruby, Chef Solo, and attempted to provision the VM:#!/bin/bash # # Install Chef-Solo if it doesn’t exist, then provision the server. # CHEF_FILE=”https://dl.dropbox.com/u/4204671/LiquidCompass/lc-chef.tar.gz”if [ “$#” -eq 0 ]; thenecho “You must provide the type of server this is. (Eg: production-api, qa-api, development)”exit 1 fiif [ ! -x “/usr/bin/chef-solo” ]; thenrpm -Uvh http://rbel
Web site is in building