# Why Doesn't This Sketch Run in Desktop Editor?

**URL:** https://discourse.processing.org/t/why-doesnt-this-sketch-run-in-desktop-editor/30098
**Category:** Libraries
**Created:** [May 14, 2021, 3:04pm UTC](https://discourse.processing.org/t/why-doesnt-this-sketch-run-in-desktop-editor/30098 "2021-05-14T15:04:51Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![cottonchipper](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/cottonchipper/32/10594_2.png) [@cottonchipper](https://discourse.processing.org/u/cottonchipper)
#### Post date: [May 14, 2021, 3:04pm UTC](https://discourse.processing.org/t/why-doesnt-this-sketch-run-in-desktop-editor/30098/1 "2021-05-14T15:04:51Z")

</div>

I found a discussion thread with an example in the P5js web editor that runs in the web editor but not when I tried copying to the desktop editor. I’m relatively new to P5js and clueless as to why it won’t run on the desktop, unless it relies on a library that I don’t have.

[https://editor.p5js.org/solub/sketches/I3V99NXlX](https://editor.p5js.org/solub/sketches/I3V99NXlX)

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [May 14, 2021, 4:30pm UTC](https://discourse.processing.org/t/why-doesnt-this-sketch-run-in-desktop-editor/30098/2 "2021-05-14T16:30:13Z")

</div>

Hello,

These are in the _index.html_ of the P5.js:

```auto
<!DOCTYPE html>
<html lang="en">
  <head>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.10.2/p5.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.10.2/addons/p5.sound.min.js"></script>
    <script src="https://d3js.org/d3.v5.js"></script>
    <script src="https://cdn.rawgit.com/jwagner/simplex-noise.js/87440528bcf8ec89840e974d8f76cfe3da548c37/simplex-noise.min.js"></script
    <link rel="stylesheet" type="text/css" href="style.css">
    <meta charset="utf-8" />

  </head>
  <body>
    <script src="sketch.js"></script>
  </body>
</html>

```

You must add them to the _index.html_ of your Processing p5.js editor.

And voila!

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/8/85c083a150aa575865ddf4ab8ee0ff14213f956a.jpeg)

Sometimes you need a web server as well.

I use this one:  
_[Web Server for Chrome - Chrome Web Store](https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb/)_

Getting started:  
_[get started | p5.js](https://p5js.org/get-started/)_

`:)`

---

<div class="post-metadata">

### Author: ![cottonchipper](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/cottonchipper/32/10594_2.png) [@cottonchipper](https://discourse.processing.org/u/cottonchipper)
#### Post date: [May 14, 2021, 5:59pm UTC](https://discourse.processing.org/t/why-doesnt-this-sketch-run-in-desktop-editor/30098/3 "2021-05-14T17:59:58Z")

</div>

Thanks! I really appreciate your help.
