Hi, just installed Particle Dev.
Unfortunately, hitting “compile” with the following code:
void setup()
{}
void loop()
{}
generates a red window with "this likely a bug in Atom"
and the following info:
[Enter steps to reproduce below:]
…
…
Atom Version: 0.0.24 System: Microsoft Windows 7 Professional Thrown From: Atom Core
Stack Trace
Uncaught Error: ENOENT: no such file or directory, uv_chdir
At D:\programs\Particle Dev\resources\app.asar\node_modules\babel-core\node_modules\regenerator\node_modules\commoner\node_modules\graceful-fs\polyfills.js:14
Error: ENOENT: no such file or directory, uv_chdir
at Error (native)
at process.chdir (D:\programs\Particle Dev\resources\app.asar\node_modules\babel-core\node_modules\regenerator\node_modules\commoner\node_modules\graceful-fs\polyfills.js:14:9)
at D:\programs\Particle Dev\resources\app.asar\node_modules\spark-dev\lib\spark-dev.js:661:21
at Object.module.exports.projectRequired (D:\spark-dev115510-2736-1mddsn1\node_modules\spark-dev\lib\spark-dev.coffee:254:4)
at D:\programs\Particle Dev\resources\app.asar\node_modules\spark-dev\lib\spark-dev.js:639:24
at Object.module.exports.loginRequired (D:\spark-dev115510-2736-1mddsn1\node_modules\spark-dev\lib\spark-dev.coffee:239:4)
at Object.module.exports.compileCloud (D:\spark-dev115510-2736-1mddsn1\node_modules\spark-dev\lib\spark-dev.coffee:461:37)
at atom-workspace.disposables.add.atom.commands.add.spark-dev:compile-cloud (D:\spark-dev115510-2736-1mddsn1\node_modules\spark-dev\lib\spark-dev.coffee:76:37)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (D:\spark-dev115510-2736-1mddsn1\src\command-registry.coffee:233:26)
at CommandRegistry.handleCommandEvent (D:\spark-dev115510-2736-1mddsn1\src\command-registry.coffee:1:0)
at CommandRegistry.module.exports.CommandRegistry.dispatch (D:\spark-dev115510-2736-1mddsn1\src\command-registry.coffee:180:5)
at space-pen-button.<anonymous> (D:\spark-dev115510-2736-1mddsn1\node_modules\tool-bar\lib\tool-bar-button-view.coffee:28:24)
at space-pen-button.jQuery.event.dispatch (D:\programs\Particle Dev\resources\app.asar\node_modules\jquery\dist\jquery.js:4435:9)
at space-pen-button.elemData.handle (D:\programs\Particle Dev\resources\app.asar\node_modules\jquery\dist\jquery.js:4121:28)
@suda, I just reinstalled the latest DEV on windows and compiled an empty setup/loop for both Core and Photon and had no errors. I created the target file in an empty folder.
Couple of quick suggestions for a first time Particle Dev user. First, although it is in the doc web page, it is easy to miss the instruction to make sure that your program file is in its own folder. All by itself.
Second, make sure to choose the spark or particle choice for languge (bottom right corner. Mine still says Spark). Save it as a Spark type file.
Give those two suggestions a try.
OH YEA, this one will get you too, once you start using Dev. Always save your program before compiling. If you don’t, you will get a successful compile indication, but when you flash the code to the photon, the last SAVED version, compiled, will be flashed, not the version on the screen in front of you. Yea, confusing, and unusual, right?
So, one folder per program. Save as Spark type file. Save before compile. Three rules of Spark Dev that can bind you up and waste a lot of time if learned the hard way. Good luck.
I have Spark as the selected language, my code is from the “Read your Photoresistor: Function and Variable” example in the docs.
I’ve attached a screenshot at the end of this post.
Dump from Atom:
Atom Version: 0.0.24 System: Mac OS X 10.10.3 Thrown From: spark-dev package, v0.0.23
Stack Trace
Uncaught Error: ENOENT: no such file or directory, uv_chdir
At /Applications/Particle Dev.app/Contents/Resources/app.asar/node_modules/spark-dev/lib/spark-dev.js:474
Error: ENOENT: no such file or directory, uv_chdir
at Error (native)
at /Applications/Particle Dev.app/Contents/Resources/app.asar/node_modules/spark-dev/lib/spark-dev.js:661:21
at Object.module.exports.projectRequired (/private/var/folders/99/3mvrfpwx19nb8w3ktwh3tfv00000gn/T/spark-dev115510-942-12j0vf0/node_modules/spark-dev/lib/spark-dev.coffee:254:4)
at /Applications/Particle Dev.app/Contents/Resources/app.asar/node_modules/spark-dev/lib/spark-dev.js:639:24
at Object.module.exports.loginRequired (/private/var/folders/99/3mvrfpwx19nb8w3ktwh3tfv00000gn/T/spark-dev115510-942-12j0vf0/node_modules/spark-dev/lib/spark-dev.coffee:239:4)
at Object.module.exports.compileCloud (/private/var/folders/99/3mvrfpwx19nb8w3ktwh3tfv00000gn/T/spark-dev115510-942-12j0vf0/node_modules/spark-dev/lib/spark-dev.coffee:461:37)
at atom-workspace.disposables.add.atom.commands.add.spark-dev:compile-cloud (/private/var/folders/99/3mvrfpwx19nb8w3ktwh3tfv00000gn/T/spark-dev115510-942-12j0vf0/node_modules/spark-dev/lib/spark-dev.coffee:76:37)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/private/var/folders/99/3mvrfpwx19nb8w3ktwh3tfv00000gn/T/spark-dev115510-942-12j0vf0/src/command-registry.coffee:233:26)
at CommandRegistry.handleCommandEvent (/private/var/folders/99/3mvrfpwx19nb8w3ktwh3tfv00000gn/T/spark-dev115510-942-12j0vf0/src/command-registry.coffee:1:0)
at CommandRegistry.module.exports.CommandRegistry.dispatch (/private/var/folders/99/3mvrfpwx19nb8w3ktwh3tfv00000gn/T/spark-dev115510-942-12j0vf0/src/command-registry.coffee:180:5)
at EventEmitter.<anonymous> (/private/var/folders/99/3mvrfpwx19nb8w3ktwh3tfv00000gn/T/spark-dev115510-942-12j0vf0/src/window-event-handler.coffee:51:20)
at emitOne (events.js:77:13)
at EventEmitter.emit (events.js:166:7)
I note that the name of your folder is Config. That’s a funny name. Is that the name of your prrogram file also? Could you expand that folder, Config ,in the file viewer to show us what else is in the folder with your program?
Best practice would be to have a folder with the same name as your program, and nothing else in that folder. Want to try that, and then try another compile?
When using Spark Dev you must put the program file in a folder of its own, by the same name, with nothing else in that folder. Have a look at the instructions on the Particle Dev help page;
Compiling Code
Before compiling your project, make sure your project files are in a dedicated directory.Notes:
If other files not related to your project are present in the project directory, you may experience errors when trying to compile.
All the files have to be on the same level (no subdirectories) like this (example shown on docs page)
so I have an empty sketch with just setup and loop, saved in an empty folder, under the same name as the folder, the type is Spark, and thanks for all your remarks, but none of them helps. Windows 7 professional.
Still the same error, which seems to have nothing to do with sketch, it’s type, folders it’s just the Atom itself not working.
I notice that your lower left corner indicated Spark, but your file type fie panel indicates CPP. I believe it should be .INO Not sure why that would cause the error, but its worth a try. Particle Dev is a bit finicky with file locations, names and extensions. It’s not as easy to use as Xcode or Arduino, where the folders are created for you and the exensions are managed by the IDE.
Close everything, start with an empty file, select type spark use the menu choice File -> Add Project Folder to create a folder and then save the file in that folder.
Glad to hear it. @suda, take a note of this thread. The Dev IDE has these idiosyncrasies and as Particle grows and attracts new customers, more and more of this forums time, and potential, yours, (when forum members tire of giving out free help for issues we’d like to see addressed by particle) will be consumed by these types of issues. The Docs may have this info, but its like someone reversing the operation of the steering wheel on your car. If your car is the only one that behaves in this weird way, people are going to get frustrated.
There is a workaround on github for this issue, which worked for me.
Work Around
Run Particle Dev, which normally brings up the previous project code
Click File: New Window
Click Open Folder…
Navigate to the folder that contains the .ino file I want to edit/compile, select it, which loads the files in the folder into the left side of the IDE.
Click on the .ino file to load it into the editor.
So the same thing happened to me. I fixed it by opening a new file saving it as ___.ino in a folder on my desktop. Everything worked fine and everything compiled, Until I saved and closed. When I went to reopen it my .ino file was blank! So I was wondering if this is happening to anyone other than me? It is very annoying to have to re-write all of my code!