coreh-deprecated / nide

Beautiful IDE for Node.js
http://coreh.github.com/nide/
713 stars 111 forks source link

Does not work in Windows #6

Open piksel opened 13 years ago

piksel commented 13 years ago

After modifying some code (getuid()-check and npm-check) the script runs, but responds with Cannot GET /.

This is not a bug, more of an feature request, but if you can provide me with some details on what is missing for windows compability I want to try to make it work. I guess npm for windows is a key functionality that is missing, I am currently using ryppi in place of npm and will try to make the script use it instead.

coreh commented 12 years ago

Hi there,

Thanks for taking the time to try running nide under Windows, as I currently don't have access to a Windows machine to test it.

The error you mention (Cannot GET /) made me think it could be an issue with Express, but I've seen people report running it just fine under Windows.

About the getuid() test, we can probably wrap that with an if to check that we're on a unix-like OS.

Perhaps some of the other stuff I'm using (like subprocesses) are still not implemented in the windows build of Node.js? Just wondering.

If you're able to get it working, I'll be happy to merge the changes you made.

DarkLinkXXXX commented 12 years ago

I get Could not find npm command. Is npm installed?

npm version is 1.1.0-beta-4

gfosco commented 12 years ago

@DarkLinkXXXX To fix that you'll have to update main.js in the nide directory to change the exec from "which npm" to just "npm".

Then you'll need to open up server.js and comment out the entire "if (process.getuid() === 0)" conditional block. (On Windows)

coreh commented 12 years ago

Quote from issue #29:

I created a project, created a new file underneath, edited it quite a bit... The file was definitely saved and updated continuously on disk. No package.json was created. I installed a NPM module and that worked correctly. (though no node_modules folder was created, so it must have been installed globally?)

I stopped the Nide process and restarted it. The project appears empty.

Quote from issue #28:

Displayed instead of previous file contents:

The arrows work to switch through the history (the timestamp on top changes) but no old versions are shown.

asifanwar98 commented 12 years ago

I've just come across issue #28 too, after having encountered #6 and fixing it using the steps mentioned by @gfosco. #28 seems to be due to the following 2 lines in the projcet.js file:

The commands "cp" and "rm" don't exist on Windows their equivalents are "COPY" & "DEL" and their usage is nearly the same,except "DEL" only Works for files to delete directories you have to use "RMDIR".

Also the separator between filepath components on windows is "\" instead of "/", which is used in the "project.js" file too.

A question I have is, wither there is any particular reason why "cp" and "rm" are being used here rather than the nodejs filesystem api's "link" (http://nodejs.org/docs/v0.6.6/api/fs.html#fs.link) and "unlink" (http://nodejs.org/docs/v0.6.6/api/fs.html#fs.unlink) functions ?

coreh commented 12 years ago

@asifanwar98: Hmm... IIRC, I used rm -rf because unlink was not working with non-empty directories. Now why am I using cp instead of link() for the version history of files is beyond me, really

It seems using rmdir /s on Windows will delete recursively. http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/rmdir.mspx?mfr=true

However, it will still not work for directories that have invisible or system files inside them. It also doesn't work for files...

clystian commented 12 years ago

@DarkLinkXXXX To fix that you'll have to update main.js in the nide directory to change the exec from "which npm" to just "npm".

@gfosco Then you'll need to open up server.js and comment out the entire "if (process.getuid() === 0)" conditional block. (On Windows)

my solution was, in nide\main.js change "which npm" to just "npm", then npm dependecie error isn't throwed and in nide\server\server.js to comment two lines "if (process.getuid() === 0) " and "process.setuid(stats.uid);", then the uid of like-unix OS is unnecesary temporally this is work for me if somebody found other solution or add better lines to this, please comment

and @Coreh if you can add a line conditional about OS in validation getui and setui that will excellent

coreh commented 12 years ago

Hello everyone, I've got good news regarding Windows support. I now have access to a Windows machine for development, and using the changes proposed by @gfosco, @asifanwar98 and @clystian, I was able to get Nide running in Windows.

There were lots of small issues (most of them related to Windows' use of backslashes), but after a few hours of work I believe Nide is now playing nicely with Windows. Besides fixing bugs, I've omited the --no-downgrade flag, since it's UNIX-specific, and added platform-specific code to mark the .npm directory as hidden.

All the Windows-related changes are right now in a separate branch, feature-windows-support: https://github.com/Coreh/nide/tree/feature-windows-support

I would like to ask you guys to test this branch under Windows, and report if everything is working fine. You can download a zip file with the contents of the branch here: https://github.com/Coreh/nide/zipball/feature-windows-support

I would also like to ask everyone with access to other systems (Linux and OS X), to test this branch on these systems, so we can be sure there are no regressions.

There are still some "UNIXisms" through the IDE, such as the handling of dot files on the directory list. We can eventually add support for the Windows equivalent (hidden files).

Thanks.

yanko commented 12 years ago

hey guys, so I just tried it on windowsXP with the feature-windows-link it creats the folder .nide on my c drive and opens chrome with the localhost:8123 it looks nice (osx in chrome lol) i get this

C:>nide init Created .nide directory Added .nide directory to .gitignore Added .nide directory to .npmignore Nide running at http://localhost:8123 { [Error: EPERM, operation not permitted 'C:\System Volume Information'] errno: 50, code: 'EPERM', path: 'C:\System Volume Information' } { [Error: UNKNOWN, unknown error 'C:\pagefile.sys'] errno: -1, code: 'UNKNOWN', path: 'C:\pagefile.sys' } { [Error: EPERM, operation not permitted 'C:\ce057ddaa6008731d6a22bfcb490d3\i386'] errno: 50, code: 'EPERM', path: 'C:\ce057ddaa6008731d6a22bfcb490d3\i386' } { [Error: EPERM, operation not permitted 'C:\ce057ddaa6008731d6a22bfcb490d3\amd64'] errno: 50, code: 'EPERM', path: 'C:\ce057ddaa6008731d6a22bfcb490d3\amd64' } { [Error: EPERM, operation not permitted 'C:\de42090700abf9048edd58e69c7257\eventlog.txt'] errno: 50, code: 'EPERM', path: 'C:\de42090700abf9048edd58e69c7257\eventlog.txt' } { [Error: EPERM, operation not permitted 'C:\Documents and Settings\All Users\Application Data\Symantec\SRTSP\Quarantine'] errno: 50, code: 'EPERM', path: 'C:\Documents and Settings\All Users\Application Data\Symantec\SRTSP\Quarantine' } { [Error: EPERM, operation not permitted 'C:\Documents and Settings\All Users\Application Data\Symantec\SRTSP\SrtETmp'] errno: 50, code: 'EPERM', path: 'C:\Documents and Settings\All Users\Application Data\Symantec\SRTSP\SrtETmp' } { [Error: EPERM, operation not permitted 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\enterprisesec.config.cch.7440.402924640'] errno: 50, code: 'EPERM', path: 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\enterprisesec.config.cch.7440.402924640' } { [Error: EPERM, operation not permitted 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\security.config.cch.7440.402924640'] errno: 50, code: 'EPERM', path: 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\security.config.cch.7440.402924640' }

and it slows down my pc dramatically, node.exe is no longer using 5mb or ram but 110mb...... why is it trying to access System Volume Information? anyways let me know what shell I do?

thankx!

yanko commented 12 years ago

found out, it was reading my c drive looking for projects lol in window xp it works in linux:ubuntu11.10 sofar works too(in virtual machine on windows xp)

thankx this is awesome, would be good to make it native for windows and ubuntu!

JimmyJune commented 12 years ago

in window version,'revert' function is not work.

Chris2011 commented 9 years ago

How about the process? Yes I have the same problem with the error Command not found npm. For now I will try the workaround with the main.js but it's still a workaround. I would like to use the standalone app for windows. Is the project still alive?

Regards

Chris