Reputation: 68
Is it possible to use npm version 2 on Bluemix? By default it runs version 1.4, but I want to "install" a package from a local directory.
Upvotes: 0
Views: 418
Reputation: 106
Probably you have to modify package.json like below:
"engines": {
"npm": "^2.1.0"
}
After that you can push your app to bluemix and verify the same in staging output. Hope it helps!!
Upvotes: 1
Reputation: 567
You could package the dependency inside your application directory, and create a "preinstall" script that will run an npm install
on that dependency:
"scripts": {
"start": "node server.js",
"preinstall": "npm install relative/path/to/module"
},
This should work locally and on Bluemix. Note that "postinstall" is also an option.
Upvotes: 0
Reputation: 3546
I was able to configure the npm version when using the community open source Node.js buildpack and setting the npm version in my package.json
. See below.
"engines": {
"npm": "^2.1.0"
}
cf push mynodeapp -b https://github.com/cloudfoundry/nodejs-buildpack
Not sure if this is possible using the default Node.js buildpack yet.
In the staging output, you should see: Npm engine: ^2.1.0
Upvotes: 2