nodists / nodist

Natural node.js and npm version manager for windows.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: Couldn't resolve version spec %s: %s

sapics opened this issue · comments

First of all, thank you very much for very useful application!

Now I got an error in nodeist@0.8.2 in Windows 8.1.
I have installed node with version 4.4.7 with nodist.

When I command node in the directory, then I got an error Sorry, there's a problem with nodist. Couldn't resolve version spec %s: %s >=4.0.0 <7.0.0 improper constraint: >=4.0.0 <7.0.0.

The directory have package.json file which includes key "engines": {"node": ">=4.0.0 <7.0.0"}, it might make problem.
When I removed the line "engines": {"node": ">=4.0.0 <7.0.0"}, then the command node works well.

commented

same issue.

Colleagues of mine also having the same issue on Windows 10. Removing <7 solved it for them: "engines": {"node": ">=4"} should work until this is resolved.

Mh. That's a bug in the semver lib for the shims.

As an intermediate fix you can override local switching with env switching: you can set the desired version using nodist env x.x.x

On July 14, 2016 11:25:39 AM CEST, Jack Cuthbert notifications@github.com wrote:

Colleagues of mine also having the same issue on Windows 10. Removing
<7 solved it for them: "engines": {"node": ">=4"} should work until
this is resolved.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#155 (comment)

Sent from my Android device with K-9 Mail. Please excuse my brevity.

Thank you @marcelklehr !
nodist env 4.4.7 works in my PC!

Current progress on this issue: I've fixed the underlying library https://github.com/marcelklehr/semver and will release a new version soon.

I've just released v0.8.3, which has the fix for this.

Thanks @marcelklehr!
It works!

Issue still persists with engines": {"node": ">=6.1 <7"} set in package.json. Complete reinstalls of version 0.8.3 on Win7 and Win10 on several machines 😞

Sorry, there's a problem with nodist. Couldn't resolve node version spec %s: %s >=6.1 <7 improper constraint: >=6.1 <7

@marcelklehr, sorry my miss report.
I had already removed engines from package.json in my project.

As @JackCuthbert pointed, the problem have not fixed yet.

Indeed. This bug is not dead, yet (TM). My Bad: I didn't upgrade the aforementioned dependency on my windows machine, thus 0.8.3 still uses the old version of semver and I'm preparing the release of 0.8.4 :)

This should be finally fixed in 0.8.4 (and the latest v0.8.5). Reopen at will. Cheers!

Not sure if it's directly connected to this, but here goes:
Tried to install typescript and then execute tsc -v (or anything else starting with tsc and I get only this:
Sorry, there's a problem with nodist. Couldn't resolve version spec %s: %s --help Unexpected character in constraint --help: --help

Hey @Mikk36, could you enable debug output with set DEBUG=nodist:*, please?

21:44:11.538 0ns    0ns    nodist:shim-node - current target directory: C:\Program Files (x86)\Nodist\bin\node_modules\typescript\bin
21:44:11.539 1ms    1ms    nodist:shim - getTargetEngine: targetDir: C:\Program Files (x86)\Nodist\bin\node_modules\typescript\bin
21:44:11.539 0ns    0ns    nodist:shim - getTargetEngine: ReadFile C:\Program Files (x86)\Nodist\bin\node_modules\typescript\bin\package.json
21:44:11.540 0ns    0ns    nodist:shim - getTargetEngine: ReadFile C:\Program Files (x86)\Nodist\bin\node_modules\typescript\package.json
21:44:11.541 1ms    1ms    nodist:shim - parsePackageJSON: {Engines:{Npm: Node:>=0.8.0}}
21:44:11.541 0ns    0ns    nodist:shim - Local file found:'--help' @ C:\Program Files (x86)\Nodist\.node-version
21:44:11.541 2ms    2ms    nodist:shim-node - Current version spec: --help
Sorry, there's a problem with nodist. Couldn't resolve version spec %s: %s --help Unexpected character in constraint --help: --help

Deleted .node-version file, problem gone.

@Mikk36 You probably ran nodist local --help at some point. If there is still a .node-version-global in the same directory, then you should be good.