Closed ackalker closed 10 years ago
$ npm version
{ http_parser: '1.0',
node: '0.10.24',
v8: '3.14.5.9',
ares: '1.9.0-DEV',
uv: '0.10.21',
zlib: '1.2.3',
modules: '11',
openssl: '1.0.1e',
npm: '1.3.21' }
I've tried with node-theseus from Git: same problem. From some searching, it looks a lot like https://github.com/adobe-research/fondue/issues/10 and that it has been fixed there. Sadly fondue's version number in Git is the same as on npm, so it isn't easy to test and install that without hacking around npm's install function (forcing install of Git version of fondue). Please consider bumping both node-theseus and fondue version numbers to some kind of 'development' version (you can always set a 'stable' version for both in their package.json :) )
Ahh, sorry about that! I have it on my to-do list to release a new version of Theseus, but I'm behind. I have to synchronize node-theseus releases with Theseus releases because Theseus asks you to npm install node-theseus
and sometimes (often) the changes are breaking.
... but what are these "development" and "stable" version numbers you mention? Is there a way of flagging a node-theseus release as "unstable, don't install this by default"?
Thanks for your quick reply! :) First off, I'm no npm guru myself, for the 'definite` (if there's anything like that) answers you should probably ask some of the people with lots and lots of packages on http://npmjs.org/ . How you version has a lot to do with your project workflow (e.g. if you use multiple Git branches for release and development), and whether you're maintaining a group of closely related modules which evolve together.
There are some niceties in npm which can make your work much easier:
npm help version
npm help semver
npm help tag
Hope this helps :)
You can also consider adding pinned versions of your dependencies as submodules in the main Git repository: see npm help submodule
. AFAICT these will then be ignored by 'npm install', so it won't pull in the wrong versions of these dependencies.
This will make it much easier for people to clone your repository (and its submodules!) and have a consistent working set to hack on. Of course, when publishing, you should still make sure that particular versions of your module go together with their dependencies as published on npmjs.org. This probably means you will have to work with separate 'release version' branches for each version you publish.
Got it, lots of options. :) Well I have some reading to do then. In the meantime, I'm going to push new versions of everything. Probably not today, but in the next few days I hope.
If this is urgent for you, what I do locally is check out fondue right in node-theseus's node_modules
directory.
Hope this helps. Thanks for all the pointers!
Good luck :) Yep, I already updated fondue in my local branch. Here's how I did it
$ # Setup local branch
$ git checkout -b hacking
$ # Install (override) fondue from Git and update package.json for easy `npm install -g`
$ npm install git://github.com/adobe-research/fondue --save
Isn't npm awesome? :)
There's a much easier way :)
Though I've been using npm for a while, I'm learning new things every time: you can use npm link
to solve all problems above. I just didn't think it would work well for modules with command-line scripts in them.
Please consider adding following setup as an example for hacking on node-theseus to README.md / Wiki / etc. for others to use.
$ mkdir adobe-research
$ cd adobe-research
$ git clone git://github.com/adobe-research/node-theseus
$ git clone git://github.com/adobe-research/fondue
$ cd fondue
$ npm install
$ cd ../node-theseus # pulls in outdated version of fondue, will be corrected in next step
$ npm install
$ # Create both a global link to development version of fondue *and* a link from node-theseus to this global link to fondue, using `npm link`'s "two-step shortcut" (see `npm help link`)
$ npm link ../fondue # Does _not_ create a global link to bin/fondue script (which is a good thing)
$ # Finally, create a global link to node-theseus, this _does_ create a global link to the bin/node-theseus script (which is what we want)
$ npm link # Works like `install -g`, except creates symlinks instead of fetching everything from the registry
That's it. But please do keep those version numbers updated :-)
Finally published the version with the fix. (I'm really sorry it took me so long.)
Thanks :-)
After installing Theseus and node-theseus, I tried running it on the following small sraping example using cheerio.
example.js:
The example runs just fine with the Node.js extension for Brackets, but running it with node-theseus I get the following error:
Brackets shows (0 calls) in the sidebar for line 7
Thinking it might have to do with the anonymous function which outputs the scrape results, I turned it into a named function.
example-test.js:
which now points the error and (0 calls) at the named function 'output':
Using Theseus 0.4.8 installed from within Brackets, node-theseus@0.2.2 installed using npm install -g, cheerio@0.13.1 installed locally.