Running latest unstable nodejs (e.g. 0.11.6) on heroku - node.js

I've not been having much luck finding an answer to this:
What is the simplest way to install/run the latest bleeding edge version of nodejs on heroku for an existing application?
There is the use of package.json engines as described here:
https://devcenter.heroku.com/articles/nodejs-support
But this does not cover the latest unstable 0.11.x branch which is the one I'm after.

Edit: as of 2013-12-12 the default buildpack can vendor any version of nodejs
Just specify the version you want in your package.json, e.g.
"engines": {
"node": "0.11.x"
}
Old:
I alomost wrote a buildback myself, but then found this one that vendors node binaries from nodejs.org:
https://github.com/arunoda/heroku-nodejs-binary-buildback
The instructions are simple, just don't forget to config:set NODE_VERSION.
YMMV: for me 0.11.7 caused NPM to fail to verify package checksums, but 0.11.6 works just fine.

Related

How can I use a custom version of a npm package in my project?

I use Primus in my project. Primus is a wrapper for websockets libraries like sockjs, which I use.
At server boot, primus creates a script, that will then be downloaded by our client, as the client part of the socket. This script embeds the source code of sockjs. Problem, it uses the 1.1.2 version of sockjs, that contains a bug, fixed in version 1.1.4, but not in Primus yet.
I asked the maintainers of Primus to change it but the are too slow to do it.
So I forked Primus, and I replaced the wrong file by the good one.
Now, I want to use this package instead of the wrong one, declared currently in my package.json.
I don't know what the good practice is in this case, the only solution I can think is to npm-publish my modified package under a different name, like amplement-primus, and then do npm install --save amplement-primus to insert it in my project. I have no idea of it breaks a rule of npm.
Do you think it's a good idea, or do you have something better in mind ?
Thank you !
I used the github url of the project to reference it in package.json:
"dependencies": {
"primus": "git+https://github.com/amplement/primus.git",
"sockjs": "^0.3.19"
},
You can use forked repo to install the package.
like :
npm install github_url_of_your_repo
For more details:
See this.

How to integrate other ember app to existing project?

I am working on ember cli version 1.12 and node js version v0.12.7,I want to intergrate ember-cli-barcode addon.I have tried following:
ember install:npm ember-cli-barcode
Then it will show message that it required node version 4 >.So I have used Node version v7.0.0 stable.I installed node modules and addon.
Then tried following command:
npm install
bower install
ember server
But It will always shows errors,of node-modules etc.Kindly help me for the same how to integrate addon and which file need to change.
This should be a comment but I can't comment yet. I'm the author and it's compatible with Ember 2.4 onward. I will be putting version compatibility information in the readme.
I haven't worked with a cli version this old but ember install should be all you need if it's compatible. The add-on is a really thin wrapper around JsBarcode, so you could use the library direct if you have stay with the current ember version.
To get the benefits of the full ember-cli ecosystem, you'd have to be using the versions that support it. I think that it began in 1.13
As mentioned, it's highly likely that this addon assumes the standard CLI setup. You could ask the author.
Depending on your app complexity, you could do a few different things.
You could use the js library https://github.com/lindell/JsBarcode - (which is what the addon uses)
OR you may want to rewrite the app with the latest and greatest - now. 1.12 is going to be expensive to keep up / and since you've likely figured out how all the logic should work, then writing it again won't be the hardest part. (this sounds fun, right?) - and then use the addon
Which will take longer?

"no template named 'WeakCallbackData' in namespace 'v8'" error when installing npm packages

Some packages that depend on https://www.npmjs.com/package/fibers fail to install with error message above. Particularly it is iron-meteor.
Homepage of the fibers states:
meteor users please read this
If you're trying to get meteor running and you ended up at this page you're probably doing something wrong. Please uninstall all versions of NodeJS and Meteor, then start over. See meteor#5124 for more information."
But it does not seem to be very helpful.
One guy recommends to downgrade node.js here https://github.com/NativeScript/NativeScript/issues/2991
It helps indeed, but it is kind of hack, right?
Node version affected: v7.2.0
Node v6.9.2 works well.
WeakCallbackData was removed from the V8 API earlier this year. Since this change has landed in Node 7, packages that rely on v8::WeakCallbackData don't work anymore. You need to downgrade Node or wait until Meteor supports Node 7, i.e., uses a newer node-fibers version.

npm install using pre-release versions

i want to use pre-release versions in my package.json to get some dependencies in the latest version (containing als pre-releases) but for some reasons it doesn't work in my case. The pre-releases are fully ignored. As an example lets use angular. If I ask "angular": ">=1.4.0-rc.0 <1.4.1" as an dependency, i would expect that i would get the version 1.4.0-rc.2 installed, but i get just the version 1.4.0.
The npm info angular shows, that there are some rc versions available like
...
'1.4.0-beta.4',
'1.4.0-beta.5',
'1.4.0-beta.6',
'1.4.0-rc.0',
'1.4.0-rc.1',
'1.4.0-rc.2',
My package.json looks as follows right now
"dependencies": {
"angular": ">=1.4.0-rc.0 <1.4.1"
}
Any ideas why i dont get any rc versions? What do i have to do to get it working?
This seems logical, the order of versions is normally the following (for angular releases 1.4.x):
1.4.0-beta.0
1.4.0-beta.2
1.4.0-beta.3
1.4.0-beta.4
1.4.0-beta.5
1.4.0-beta.6
1.4.0-rc.0
1.4.0-rc.1
1.4.0-rc.2
1.4.0
1.4.1
If you request "angular": ">=1.4.0-rc.0 <1.4.1", The latest version that is less strictly 1.4.1 is 1.4.0
Anyway, if you demand "angular": ">=1.4.0-rc.0 <1.4.0", the latest version will be 1.4.0-rc.2

How do I use the older version of node.js buildpack?

I've been using Node.js as my runtime within Bluemix for a few weeks now but I saw somewhere that there's a new version of the runtime now live on Bluemix. I have some changes to my app that need to be pushed but I'm not sure if I'm quite ready to move to the new buildpack version yet. Is there a way to use the older version of the buildpack while I complete my testing?
Yes, you can still use v1.18, as it will be available on Bluemix for a period of time and can be accessed using the CF command below:
$ cf push your_app_name -b sdk-for-nodejs_v1-18-20150519-1759
Or, you can specify the following in your manifest.yml:
buildpack: sdk-for-nodejs_v1-18-20150519-1759
All available buildpacks installed on the system can be viewed using the following command:
$ cf buildpacks
If you're concerned about the default version of Node.js moving from 0.10 to 0.12 with the buildpack updates, it is still possible to manually specify the runtime version by setting the following property in your package.json file:
"engines": {
"node": "0.10.x"
}

Resources