acconut / brackets-nodejs Goto Github PK
View Code? Open in Web Editor NEWConnecting Brackets and Node.js
License: MIT License
Connecting Brackets and Node.js
License: MIT License
I was having a look at my lsof -i
output, and got the following for Brackets:
Brackets 9912 sven 49u IPv4 2868533 0t0 TCP localhost:9234 (LISTEN)
Brackets- 9935 sven 29u IPv4 2869790 0t0 TCP localhost:49951 (LISTEN)
Brackets- 9935 sven 43u IPv4 2868634 0t0 TCP *:7777 (LISTEN)
Brackets- 9935 sven 49u IPv4 2868533 0t0 TCP localhost:9234 (LISTEN)
After a bit of Googling, it seems that the TCP *:7777
entry originates from this extension (which I have installed). Is there a particular reason for having it listen on *
, rather than localhost
? The current approach could result in security issues on non-firewalled systems, depending on the exposed API.
I cloned the extension, I started the socket.js, I created an app.js in /Users/Michael/Sites/ with content: console.log('Hello World'); Now I "Run (Node.js)" and get the following error in Brackets' console:
module.js:340
trow err;
^
Error: Cannot find module '/Users/Michael/Library/Application Support/Brackets/extensions/user/brackets-nodejs/Users/Michael/Sites/app.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
The file path is wrong. Did I set up your module correctly? Thanks anyway, this extension looks promising.
Found a little follow up :)
env: node: No such file or directory
Programm exited.
/usr/local/bin/npm (next to node)
I had a quick look myself paths are correct, your console.log output
"/usr/local/bin/node" "/usr/local/bin/npm"
I guess there is a problem with the symlink handling.
Greetz
Hi, very impressive extensions, i use a lot and love it !
Just wnt to know if possible close the bottom panel with 'escape' key and/or MMB click !
Thank's a lot
Great extension! :+1
Perhaps the extension should inform in log the user if there are unsaved changes, as the user may expect that what he sees is what is executed?
Hi,
Thanks for the great plugin. Can you please put notes of each release on the wiki.
It would be nice to track what has changed in each release.
Thanks!
I was thinking that it would be useful to allow buffers to be run as well. This can be achieved by creating a temporary file for the buffer and running that. Otherwise, it would be better to display an error message saying buffers cannot be run. If that is OK, I would like to tackle this issue.
Each time process writes to the console it should update the terminal with that new message regardless of a new line. (If you run node in other programs like cmd.exe
this is how it works)
If I do not print a new line character the terminal is not updated until the next newline is seen or the program exits.
Use process.stdout.write()
instead of console.log()
to print data to the console. Until your program writes a newline char \n
it does not show on the terminal.
var intervalExecCount = 0;
var intervalID = setInterval(function(){
++intervalExecCount;
if(intervalExecCount<5){
process.stdout.write('.'); // won't print this until process ends
}else{
clearInterval(intervalID);
}
}, 1000);
Hi,
node.js>run and node.js>execute won't run. For the first one I get 'Program exited' when running a simple node server, but this server does run on the command line. For the second if I use 'node -v' I get the same, and yet the command line gives v0.12.7.
If I run node.js> run as npm test I get '/bin/sh: 1: npm: not found'
'which node/npm' gives me a directory of '/home/pc/.linuxbrew/bin' for both. If I set both 'node.js>configuration> paths to node/npm' to this path I get:
'/bin/sh: 1: /home/pc/.linuxbrew/bin: Permission denied'
I am owner:group pc:pc on this directory and paths to it, and ps aux shows pc is running brackets:
pc 12785 0.5 0.4 579096 55464 ? Sl 12:56 0:03 /opt/brackets/Brackets --lang=en-US --log-severity=disable --remote-debugging-port=9234 --no-sandbox
pc 12790 0.0 0.1 306208 16000 ? S 12:56 0:00 /opt/brackets/Brackets --lang=en-US --log-severity=disable --remote-debugging-port=9234 --no-sandbox
pc 12791 0.0 0.2 313168 33776 ? S 12:56 0:00 /opt/brackets/Brackets --type=zygote --no-sandbox --lang=en-US --log-severity=disable
pc 12809 0.1 0.7 1015740 87856 ? Sl 12:56 0:01 /opt/brackets/Brackets-node /opt/brackets/node-core
pc 12812 1.7 1.5 1618724 183848 ? Sl 12:56 0:09 /opt/brackets/Brackets --type=renderer --no-sandbox
Node was installed via linuxbrew, I'm running Ubuntu 15.04 mate 64bit.
I'm clearly doing something daft here - any ideas what??
Best wishes,
PC
Hi,
I am running Brackets (ver. sprint 36 experimental build 0.36.0-11506 (release 942505c3a)) with Node.js (ver. 0.10.26) and Node.js Bindings (ver. 1.1.2). I configured the plugin to point to the location of node and npm on my computer. I then tested the following code:
/*jslint vars: true, plusplus: true, devel: true, nomen: true,
indent: 4, maxerr: 50 */
/*global define */
function sayHello() {
"use strict";
console.log("Hello");
}
sayHello();
And i only get "Program exited" in the Terminal window.
Can you tell me where i am going wrong? Or, is there a bug in the plugin?
Thanks in advance and hear from you.
Whenever I run an npm command from the menu, it seems to cd to the folder of whatever file I happen to have open and thus often fails when it can't find package.json.. It should always just run them from project root, or alternatively from the folder of whichever package.json is nearest the root..
I updated the plugin and now it doesn't work. The problem is it doesn't put the executed js file path in quotation marks:
Terminal: "c:\Program Files\nodejs\node.exe" C:/Program Files/NpmProjects/jsFilesRun.js
module.js:914
throw err;
^
Error: Cannot find module 'C:\Program'
at Function.Module._oldRes (module.js:912:15)
at Function.Module._resolveFilename (module.js:1013:16)
at Function.Module._load (module.js:274:22)
at Function.Module.runMain (module.js:530:11)
at startup (node.js:183:16)
at node.js:1358:1509
Program exited.
Hi, I am trying to use your extension for brackets and it is always giving me an error like
"Cannot find module /undefined". When I use command line: node test.'s everything is working just fine.
What could be an issue?
The first line of terminal window is always hidden (scrolled down) and the scrollbar is always active and we have to scroll it up to see the results even with single line result.
I got this error when I tried to run a simple test script. The error is:
/bin/sh: node: command not found
Program exited with status code of 127.
Bracket version: Release 1.11 build 1.11.0-17524 (release 86b5e2d4e)
Relative error from stackoverflow: https://stackoverflow.com/questions/40894674/node-not-found-when-using-brackets-ide
I would like to see a small button, or toggle which would enable the log to be followed.
This would not require me to constantly scroll to the bottom to see what my current http request status is.
One example is the Travis CL build system's online log.
Would it be possible to allow shell commands from the plugin eg/nodemon server.js or provide additional menu items for nodemon and/or node-theseus?
Currently looking into a possiblity to run the a node file in debug mode, and starting node-inspector and chrome with it.
COuld that be usefull?
Edit1: ALmost done, only looking for a way to open browser.
Hello Acconut and comunity
I´ve an annoying issue with this brackets extention: Even if it worked perfectly in the beginning, now I´m not abled to use it at all. Everytime I try the terminal-window pops up but its completely empty exept of the terminal term "node C:/bla/foo/bums.js". after a while it shows "Program exited"! <-- I´ve tried the same with windows´ console where it worked perfectly. Further all other commands e.g "run as npm start" etc. result in nothing but "program exited"
it would be just great if anybody could help me with this I liked that tool alot!
My setup:
Brackets Sprint 37
on windows 7 home
Is it possible to just parse the projects Package.json scripts section for the menu actions to go in brackets?
There's an open ticket for npm debug I assume at some point someone will ask for custom tasks so is it possible to just skip to using the defined commands in the package?
For instance my project looks like;
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start-dev": "nodemon server",
"start": "node server.js"
},
So I could get the "start dev" listed in the brackets menu.
OS X 10.8.3
Brackets Sprint 23
node: /usr/local/bin/node
node -v = v0.10.4
Both [Terminate] and [Terminate & Close] don't work. Server instance remains running in the background until you completely close Brackets. Unusable as a result.
sprint 37 experimental build 0.37.0-12014 (release abbda8dd2)
Hello,
First, amazing plugin. Thank you so much. Second, I'm working on a Node app with several server side files. I have one "main.js" entry file that always starts it. Is there an easy way to make a new setting so that it can always execute the "main.js" file instead of the one I'm currently working on?
Thank you
npm ERR! Error: EPERM, mkdir 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\node_modules'
I've struggled with this over the past month and only now figured it out. npm install will not work in an empty project. Creating an empty file and opening it first allows it to behave normally.
Been using Brackets with the nodjs extension on both Win7 and Ubuntu for most of this year. Recently moved to a Macbook and the extension can not locate the npm command and executing a command from the node.js menu returns this error.
/bin/sh: npm: command not found
Yet if I run the commands from other IDEs, it works as designed. Running in a terminal window, I see this.
$ npm config list
; cli configs
registry = "https://registry.npmjs.org/"
user-agent = "npm/1.4.28 node/v0.10.33 darwin x64"
; userconfig /Users/--------/.npmrc
flex-sdk:npm_cmd_ran = "install"
; node bin location = /usr/local/bin/node
; cwd = /Users/--------
; HOME = /Users/--------
; 'npm config ls -l' to show all defaults.
$ which node
/usr/local/bin/node
$ which npm
/usr/local/bin/npm
I have tried using the Node.js configuration option to specify the path and it also does not find npm.
I am sure that this is probably a simple environment fix on the Macbook but it has be befuddled since all other IDEs and applications seem to be able to find it.
System is a Macbook Pro 15 running OS X Yosemite (10.10.1)
Thanks.
It could be useful that we define our custom commands for example unit testing and ... currently i have to change the codes manually!
Hi,
Have installed latest update and like the new feature of showing what command just run and refreshing/re-running that command.
I was wondering if on the terminal window we could have a textbox to run the Execute Command feature and then have a dropdown of the last 10 commands that have been run?
Alternatively you could have a combined textbox/dropdown...
I'm using readline
module and using prompt
setprompt
but it doesn't seem to work when I use the Run command with this plugin
It would be good to have an ability to set/save local path to a file (eg: start.js) which I need to start when I click "Run" from menu. Currently I always need to select this file and then select run (or typing in the full path to execute from menu), and becomes difficult when I'm working on some other folder/files and have to run it.. If this was able to set the path, I could have just run from anywhere in the project.
BTW, this is not an issue, but a good to have feature request. You have done a good job with the plugin, it's very useful.
First off, thank you for this excellent extension!
The npm install command does not work. The dialog opens, I type the package name, and click done. At that point, an error message (visible in the Brackets dev console) is thrown:
"Uncaught TypeError: Object # has no method 'npm' main.js:357"
Hopefully you can track down the issue soon. 😃
I have installed Minifier extension. But your extension encounters an error with it.
Brackets Sprint 38 on Mavericks, Node JS Bindings 1.1.3
Repro:
Result: A tilde (~) character appears in source
Expect: app.js to be run by Brackets
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.