Is it possible to use npm 3.x with nodejs 4.x?

See chapter. I searched everything on the Internet and did not find a solid answer.

The reason I want to use npm3 is because I work in a Windows environment and I end up with a path name that is too long. Migrating from Windows is not currently viable.

Also, I cannot upgrade to node 5.x because I am using a karma test drive that is not yet supported on node 5.x

So I want to use node 4.x with npm 3.x.

I successfully upgraded my machine using the npm-windows-upgrade package to use npm 3 with node 4.

After the update, I saw a couple of problems with karma, not realizing that jasmine / phantomjs is available. The workaround was to simply install both of these packages locally.

+8
windows npm karma-runner
source share
1 answer

Yes. Npm 3.x is compatible with node 4.x. In fact, any node> = 0.8 is fine.

This is documented at https://www.npmjs.com/package/npm#important. To run this program, you need node v0.8 or later.

And yet, I suggest you use nvm https://github.com/creationix/nvm It is very easy to switch in different node environments using nvm.

Your jasmine / phantomjs is a peerDependencies link, npm 2.x will install it if missing, and an error is reported if the found version conflicts with several packages.

As you know, npm 3.x smooths package dependencies, peerDependencies will only print a warning line (will not install), you must manually include peerDependencies in your package.json file, which means that you determine which version should be installed .

+4
source share

All Articles