<p>This solution fixed it for me: <a href="https://stackoverflow.com/questions/42308879/how-to-solve-npm-error-npm-err-code-elifecycle">https://stackoverflow.com/questions/42308879/how-to-solve-npm-error-npm-err-code-elifecycle</a></p>

CC BY-SA 4.0
2022-01-22T10:39:13.120Z
As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Community
CC BY-SA 4.0
2022-01-17T19:47:31.813Z
2022-01-23T15:30:33.853Z
2022-01-23T15:30:33.853Z
Tom
<p>This solution <a href="https://cardano.stackexchange.com/a/6451/2758">https://cardano.stackexchange.com/a/6451/2758</a> is what finally did it for me:</p>
<pre><code>GC_DONT_GC=1 npm run start
</code></pre>
<p>instead of just
<code>npm run start</code></p>
<p>Heads up to anyone else seeing this issue!</p>
<p>Edit: to clarify, I'd already seen that post, but when OP said the cache clear had resolved the issue for him, I figured it was something else affecting my build (and it was). Thanks to the last commenter on that thread!</p>
<p>Edit2: immediately after solving this issue I ran into dependency issues when trying to compile in the playground. This was resolved by restarting the server with the same prefix</p>
<pre><code>GC_DONT_GC=1 plutus-playground-server
</code></pre>
<p>and then reconnecting the client. This post also contains additional steps - <a href="https://github.com/renzwo/cardano-plutus-apps-install-m1/blob/main/README.md" rel="nofollow noreferrer">https://github.com/renzwo/cardano-plutus-apps-install-m1/blob/main/README.md</a></p>

CC BY-SA 4.0
2022-01-22T21:22:16.783Z
I can confirm this worked for me, darn GC_DONT_GC=1.  macOS i7 monterey (v12.1). Else when I compiled in the playground I got "error Could not find module"
TheStophe
CC BY-SA 4.0
2022-01-14T21:59:01.353Z
2022-01-16T20:08:21.313Z
2022-01-16T20:08:21.313Z
Woodland Pools
<p>I'm trying to run the plutus-playground-client. My OS is macOS Big Sur 11.6.2</p>
<p>I have set up the environment with the following steps based on the nix install instructions from:
<a href="https://docs.plutus-community.com/docs/setup/MacOS.html" rel="nofollow noreferrer">https://docs.plutus-community.com/docs/setup/MacOS.html</a></p>
<p>and the playground setup instructions (on page 2) from:
<a href="https://docs.google.com/document/d/13112LHG9vVvNUs40oZSqZ-DF6_yFiT_SJZ2NaEmjMM4/edit#" rel="nofollow noreferrer">https://docs.google.com/document/d/13112LHG9vVvNUs40oZSqZ-DF6_yFiT_SJZ2NaEmjMM4/edit#</a></p>
<p>These are the exact steps I've taken for setup:</p>
<pre><code># install nix
$ sh &lt;(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume

# check version 
$ nix --version # prints (nix (Nix) 2.5.1)

# edit nix conf file
$ sudo nano /etc/nix/nix.conf

# after edit, contents of conf file are
build-users-group = nixbld
experimental-features = nix-command
substituters        = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=volume

# restart Mac (confirmed this step is needed, or cache isn't recognized)

# clone plutus-apps repo
$ git clone https://github.com/input-output-hk/plutus-apps

# cd into plutus-apps
$ cd plutus-apps

# checkout latest commit
$ git checkout 41149926c108c71831cfe8d244c83b0ee4bf5c8a

# build server (confirmed after mac restart, cache is recognized and this builds in 1-2 min)
$ nix-build -A plutus-playground.server

# enter nix-shell (as expected, first time always takes ~1 hour)
$ nix-shell

# once in nix-shell, run playground server
$ cd plutus-playground-client
$ plutus-playground-server

# server builds successfully, output printed below:
plutus-playground-server: for development use only
[Info] Running: (Nothing,Webserver {_port = 8080, _maxInterpretationTime = 80s})
Initializing Context
Initializing Context
Warning: GITHUB_CLIENT_ID not set
Warning: GITHUB_CLIENT_SECRET not set
Warning: JWT_SIGNATURE not set
Interpreter ready 

# in second terminal, enter nix-shell
$ nix-shell

# attempt to run client
$ cd plutus-playground-client
$ npm run start

</code></pre>
<p>client starts building, but always runs into the following error.</p>
<pre><code>plutus-playground-server: user error (Error evaluating simulation: InterpreterError (CompilationErrors [CompilationError {filename = &quot;\n/private/tmp/web-ghc-work-81ca65233755c126/Main.hs&quot;, row = 2, column = 1, text = [&quot; error:&quot;,&quot;    Could not find module \8216Playground.Contract\8217&quot;,&quot;    Use -v (or `:set -v` in ghci) to see a list of the files searched for.&quot;,&quot;  |&quot;,&quot;2 | import Playground.Contract&quot;,&quot;  | ^^^^^^^^^^^^^^^^^^^^^^^^^^&quot;]},CompilationError {filename = &quot;/private/tmp/web-ghc-work-81ca65233755c126/Main.hs&quot;, row = 3, column = 1, text = [&quot; error:&quot;,&quot;    Could not find module \8216Plutus.Contract\8217&quot;,&quot;    Use -v (or `:set -v` in ghci) to see a list of the files searched for.&quot;,&quot;  |&quot;,&quot;3 | import Plutus.Contract&quot;,&quot;  | ^^^^^^^^^^^^^^^^^^^^^^&quot;]},CompilationError {filename = &quot;/private/tmp/web-ghc-work-81ca65233755c126/Main.hs&quot;, row = 4, column = 1, text = [&quot; error:&quot;,&quot;    Could not find module \8216PlutusTx.Prelude\8217&quot;,&quot;    Use -v (or `:set -v` in ghci) to see a list of the files searched for.&quot;,&quot;  |&quot;,&quot;4 | import PlutusTx.Prelude&quot;,&quot;  | ^^^^^^^^^^^^^^^^^^^^^^^&quot;]}]))
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! plutus-playground-client@1.0.0 start: `plutus-playground-generate-purs &amp;&amp; npm install &amp;&amp; npm run install:spago &amp;&amp; npm run build:webpack:dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the plutus-playground-client@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/gmoratorio/.npm/_logs/2022-01-14T20_08_36_926Z-debug.log
</code></pre>
<p>It looks like it can't resolve several dependencies</p>
<pre><code>Playground.Contract
Plutus.Contract
PlutusTx.Prelude
</code></pre>
<p>but I can't figure out how to fix the resolution.</p>
<p>I've tried wiping my install and starting over several times including running</p>
<pre><code>nix-collect-garbage
nix-build -A plutus-playground.server
</code></pre>
<p>after reinstalling nix, and every time I get the same dependency resolution error.</p>
<p>Any help or ideas would be appreciated</p>

<plutus-pioneer-program><plutus-playground>
npm run start in plutus-playground-client throws several "Could not find module" errors
# npm run start in plutus-playground-client throws several "Could not find module" errors

(Asked by: username_0 on 2022-01-14)

I'm trying to run the plutus-playground-client. My OS is macOS Big Sur 11.6.2
I have set up the environment with the following steps based on the nix install instructions from:
https://docs.plutus-community.com/docs/setup/MacOS.html
and the playground setup instructions (on page 2) from:
https://docs.google.com/document/d/13112LHG9vVvNUs40oZSqZ-DF6_yFiT_SJZ2NaEmjMM4/edit#
These are the exact steps I've taken for setup:
# install nix
$ sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume

# check version 
$ nix --version # prints (nix (Nix) 2.5.1)

# edit nix conf file
$ sudo nano /etc/nix/nix.conf

# after edit, contents of conf file are
build-users-group = nixbld
experimental-features = nix-command
substituters        = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=volume

# restart Mac (confirmed this step is needed, or cache isn't recognized)

# clone plutus-apps repo
$ git clone https://github.com/input-output-hk/plutus-apps

# cd into plutus-apps
$ cd plutus-apps

# checkout latest commit
$ git checkout 41149926c108c71831cfe8d244c83b0ee4bf5c8a

# build server (confirmed after mac restart, cache is recognized and this builds in 1-2 min)
$ nix-build -A plutus-playground.server

# enter nix-shell (as expected, first time always takes ~1 hour)
$ nix-shell

# once in nix-shell, run playground server
$ cd plutus-playground-client
$ plutus-playground-server

# server builds successfully, output printed below:
plutus-playground-server: for development use only
[Info] Running: (Nothing,Webserver {_port = 8080, _maxInterpretationTime = 80s})
Initializing Context
Initializing Context
Warning: GITHUB_CLIENT_ID not set
Warning: GITHUB_CLIENT_SECRET not set
Warning: JWT_SIGNATURE not set
Interpreter ready 

# in second terminal, enter nix-shell
$ nix-shell

# attempt to run client
$ cd plutus-playground-client
$ npm run start


client starts building, but always runs into the following error.
plutus-playground-server: user error (Error evaluating simulation: InterpreterError (CompilationErrors [CompilationError {filename = "\n/private/tmp/web-ghc-work-81ca65233755c126/Main.hs", row = 2, column = 1, text = [" error:","    Could not find module \8216Playground.Contract\8217","    Use -v (or `:set -v` in ghci) to see a list of the files searched for.","  |","2 | import Playground.Contract","  | ^^^^^^^^^^^^^^^^^^^^^^^^^^"]},CompilationError {filename = "/private/tmp/web-ghc-work-81ca65233755c126/Main.hs", row = 3, column = 1, text = [" error:","    Could not find module \8216Plutus.Contract\8217","    Use -v (or `:set -v` in ghci) to see a list of the files searched for.","  |","3 | import Plutus.Contract","  | ^^^^^^^^^^^^^^^^^^^^^^"]},CompilationError {filename = "/private/tmp/web-ghc-work-81ca65233755c126/Main.hs", row = 4, column = 1, text = [" error:","    Could not find module \8216PlutusTx.Prelude\8217","    Use -v (or `:set -v` in ghci) to see a list of the files searched for.","  |","4 | import PlutusTx.Prelude","  | ^^^^^^^^^^^^^^^^^^^^^^^"]}]))
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! plutus-playground-client@1.0.0 start: `plutus-playground-generate-purs && npm install && npm run install:spago && npm run build:webpack:dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the plutus-playground-client@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/gmoratorio/.npm/_logs/2022-01-14T20_08_36_926Z-debug.log

It looks like it can't resolve several dependencies
Playground.Contract
Plutus.Contract
PlutusTx.Prelude

but I can't figure out how to fix the resolution.
I've tried wiping my install and starting over several times including running
nix-collect-garbage
nix-build -A plutus-playground.server

after reinstalling nix, and every time I get the same dependency resolution error.
Any help or ideas would be appreciated

**Tags:** plutus-pioneer-program, plutus-playground

---

## 2 answers

### Answer by username_0 on 2022-01-14. Score: 7 | Accepted answer

This solution https://cardano.stackexchange.com/a/6451/2758 is what finally did it for me:
GC_DONT_GC=1 npm run start

instead of just
npm run start
Heads up to anyone else seeing this issue!
Edit: to clarify, I'd already seen that post, but when OP said the cache clear had resolved the issue for him, I figured it was something else affecting my build (and it was). Thanks to the last commenter on that thread!
Edit2: immediately after solving this issue I ran into dependency issues when trying to compile in the playground. This was resolved by restarting the server with the same prefix
GC_DONT_GC=1 plutus-playground-server

and then reconnecting the client. This post also contains additional steps - https://github.com/renzwo/cardano-plutus-apps-install-m1/blob/main/README.md

> **Comments:**
> **username_3**: I can confirm this worked for me, darn GC_DONT_GC=1.  macOS i7 monterey (v12.1). Else when I compiled in the playground I got "error Could not find module"  

---

### Answer by username_1 on 2022-01-17. Score: 0

This solution fixed it for me: <https://stackoverflow.com/questions/42308879/how-to-solve-npm-error-npm-err-code-elifecycle>

> **Comments:**
> **username_2**: As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).  

---

