# Dfx deploy failed

**URL:** https://forum.dfinity.org/t/dfx-deploy-failed/3741
**Category:** Developers
**Tags:** Functional-Programming
**Created:** [May 15, 2021, 2:15pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741 "2021-05-15T14:15:22Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![GaloisField](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/galoisfield/32/1625_2.png) [@GaloisField](https://forum.dfinity.org/u/GaloisField)
#### Post date: [May 15, 2021, 2:15pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/1 "2021-05-15T14:15:22Z")

</div>

Hello everyone,  
I try to achieve the Quick Start in local development but there are some errors which I don’t understand.

I had launch dfx start which is running on one window. On another I tap `dfx deploy` but at the middle of process I have this message :  
" The post-build step failed for canister ‘ryjl3-tyaaa-aaaaa-aaaba-cai’ with an embedded error: The command ‘“npm” “run” “build”’ failed with exit status ‘exit code: 1’.

Stdout:

> hello\_assets@0.1.0 build

> webpack  
> "

I have npm, but apparently my console doesn’t know “run” and “build”…

Furthermore, when I try `dfx canister call hello greet everyone` I have :  
"The Replica returned an error: code 3, message: “Attempt to execute a message on canister rrkah-fqaaa-aaaaa-aaaaq-cai which contains no Wasm module”.

I have download wasm3 with` brew install` and error persist.

I haven’t find answer on this forum so I put here, but if this topic is already solved I can erase 🙂

---

<div class="post-metadata">

### Author: ![Ori](https://avatars.discourse-cdn.com/v4/letter/o/ecae2f/32.png) [@Ori](https://forum.dfinity.org/u/Ori)
#### Post date: [May 15, 2021, 4:49pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/3 "2021-05-15T16:49:56Z")

</div>

Try running `npm install` in the project directory first, see if that resolves it.

---

<div class="post-metadata">

### Author: ![GaloisField](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/galoisfield/32/1625_2.png) [@GaloisField](https://forum.dfinity.org/u/GaloisField)
#### Post date: [May 15, 2021, 5:01pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/4 "2021-05-15T17:01:10Z")

</div>

I have done but problem persist

---

<div class="post-metadata">

### Author: ![GaloisField](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/galoisfield/32/1625_2.png) [@GaloisField](https://forum.dfinity.org/u/GaloisField)
#### Post date: [May 15, 2021, 5:05pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/5 "2021-05-15T17:05:44Z")

</div>

When I try `run` it says  
“Input file not found : ‘Runfile’ : Please create the file or specify an alternative”.

Logic I haven’t specified any and I don’t know what file use `run`

---

<div class="post-metadata">

### Author: ![lsgunn](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/lsgunn/32/124_2.png) [@lsgunn](https://forum.dfinity.org/u/lsgunn)
#### Post date: [May 15, 2021, 5:35pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/6 "2021-05-15T17:35:08Z")

</div>

You might try the following:  
dfx stop (if you haven’t already done that)  
rm -rf .dfx (to remove the .dfx directory from your project directory)  
dfx start —clean  
npm install  
dfx deploy

You don’t need to use the npm build or run commands directly.  
HTH

---

<div class="post-metadata">

### Author: ![GaloisField](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/galoisfield/32/1625_2.png) [@GaloisField](https://forum.dfinity.org/u/GaloisField)
#### Post date: [May 15, 2021, 5:46pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/7 "2021-05-15T17:46:16Z")

</div>

Thank you I will try

---

<div class="post-metadata">

### Author: ![GaloisField](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/galoisfield/32/1625_2.png) [@GaloisField](https://forum.dfinity.org/u/GaloisField)
#### Post date: [May 15, 2021, 5:50pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/8 "2021-05-15T17:50:42Z")

</div>

Is it normal dfx start --clean has launch :  
"May 15 17:46:49.281 INFO ic-starter. Configuration: ValidatedConfig … May 15 17:46:51.666 WARN s:fscpm-uiaaa-aaaaa-aaaap-yai/n:wllx2-nstc6-mnfju-dii5p-fjosw-bautj-sqrnt-yfbje-aoqbd-l3ux2-wqe/ic\_http\_handler/ic\_http\_handler NNS subnet not found in network topology. Skipping fetching the delegation.

Starting webserver on port 52457 for replica at “[http://localhost:52457](http://localhost:52457)”

binding to: V4(127.0.0.1:8000)

replica(s): [http://localhost:52457/](http://localhost:52457/)" ?

---

<div class="post-metadata">

### Author: ![Ori](https://avatars.discourse-cdn.com/v4/letter/o/ecae2f/32.png) [@Ori](https://forum.dfinity.org/u/Ori)
#### Post date: [May 15, 2021, 7:43pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/9 "2021-05-15T19:43:26Z")

</div>

Yes, you’ll see continuous output in the terminal running dfx start. You can run all other commands in a second terminal.

---

<div class="post-metadata">

### Author: ![GaloisField](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/galoisfield/32/1625_2.png) [@GaloisField](https://forum.dfinity.org/u/GaloisField)
#### Post date: [May 15, 2021, 8:04pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/10 "2021-05-15T20:04:24Z")

</div>

I really don’t understand 😅.

I remove all folders, I have done each tips to download all again and I have always this after `dfx start` in a window and `dfx deploy` in another :  
result of dfx deploy  
"dfx deploy  
Deploying all canisters.  
Creating canisters…  
Creating canister “hello”…  
Creating the canister using the wallet canister…  
Creating a wallet canister on the local network.  
The wallet canister on the “local” network for user “default” is “rwlgt-iiaaa-aaaaa-aaaaa-cai”  
“hello” canister created with canister id: “rrkah-fqaaa-aaaaa-aaaaq-cai”  
Creating canister “hello\_assets”…  
Creating the canister using the wallet canister…  
“hello\_assets” canister created with canister id: “ryjl3-tyaaa-aaaaa-aaaba-cai”  
Building canisters…  
Building frontend…  
The post-build step failed for canister ‘ryjl3-tyaaa-aaaaa-aaaba-cai’ with an embedded error: The command ‘“npm” “run” “build”’ failed with exit status ‘exit code: 1’.  
Stdout:

> hello\_assets@0.1.0 build  
> webpack

Stderr:  
/Users/galoisfield/ic-project/hello/node\_modules/terser-webpack-plugin/dist/index.js:607  
const hooks = compiler.webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(compilation);  
^

TypeError: Cannot read property ‘javascript’ of undefined  
at /Users/galoisfield/ic-project/hello/node\_modules/terser-webpack-plugin/dist/index.js:607:38  
at SyncHook.eval [as call] (eval at create…  
at Object. (/Users/galoisfield/ic-project/hello/node\_modules/webpack-cli/bin/cli.js:366:3)  
at Module.\_compile (node:internal/modules/cjs/loader:1109:14)".

I don’t understand the error message and I try all recommendations.

But thank you very much for your comment, maybe I will find something randomly 😄

---

<div class="post-metadata">

### Author: ![Ori](https://avatars.discourse-cdn.com/v4/letter/o/ecae2f/32.png) [@Ori](https://forum.dfinity.org/u/Ori)
#### Post date: [May 15, 2021, 8:08pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/11 "2021-05-15T20:08:02Z")

</div>

Does a brand new project created by `dfx new hello` deploy successfully?

---

<div class="post-metadata">

### Author: ![claudio](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/claudio/32/322_2.png) [@claudio](https://forum.dfinity.org/u/claudio)
#### Post date: [May 15, 2021, 9:54pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/12 "2021-05-15T21:54:10Z")

</div>

What’s your version of npm (and maybe dfx to be sure). And what OS are you using?

---

<div class="post-metadata">

### Author: ![GaloisField](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/galoisfield/32/1625_2.png) [@GaloisField](https://forum.dfinity.org/u/GaloisField)
#### Post date: [May 15, 2021, 10:06pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/13 "2021-05-15T22:06:03Z")

</div>

No I tried and I have the previous message.

> [@claudio](#):
>
> What’s your version of npm (and maybe dfx to be sure). And what OS are you using?

npm : 7.11.2  
dfx : dfx 0.6.26

And MacOS the last

---

<div class="post-metadata">

### Author: ![GaloisField](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/galoisfield/32/1625_2.png) [@GaloisField](https://forum.dfinity.org/u/GaloisField)
#### Post date: [May 15, 2021, 10:07pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/14 "2021-05-15T22:07:57Z")

</div>

> [@GaloisField](#):
>
> The command ‘“npm” “run” “build”’ failed with exit status ‘exit code: 1’.

I really don’t understand why this commands failed

---

<div class="post-metadata">

### Author: ![GaloisField](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/galoisfield/32/1625_2.png) [@GaloisField](https://forum.dfinity.org/u/GaloisField)
#### Post date: [May 15, 2021, 10:08pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/15 "2021-05-15T22:08:45Z")

</div>

I tried dfx build too but it’s the same.

---

<div class="post-metadata">

### Author: ![claudio](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/claudio/32/322_2.png) [@claudio](https://forum.dfinity.org/u/claudio)
#### Post date: [May 15, 2021, 10:24pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/16 "2021-05-15T22:24:24Z")

</div>

Might be a red herring, but my machine (Ubuntu 20.04) reports  
npm 6.14.4 and node v10.19.0.

Maybe try `dfx new --no-frontend <projname>` to see if you can at least create and build a pure Motoko project without a frontend.

Hopefully some Mac user can chime in with what works for them.

---

<div class="post-metadata">

### Author: ![GaloisField](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/galoisfield/32/1625_2.png) [@GaloisField](https://forum.dfinity.org/u/GaloisField)
#### Post date: [May 15, 2021, 10:43pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/17 "2021-05-15T22:43:12Z")

</div>

Okay here it’s right 😁  
" dfx deploy

Deploying all canisters.

Creating canisters…

Creating canister “hello2”…

Creating the canister using the wallet canister…

Creating a wallet canister on the local network.

The wallet canister on the “local” network for user “default” is “rwlgt-iiaaa-aaaaa-aaaaa-cai”

“hello2” canister created with canister id: “rrkah-fqaaa-aaaaa-aaaaq-cai”

Creating canister “hello2\_assets”…

Creating the canister using the wallet canister…

“hello2\_assets” canister created with canister id: “ryjl3-tyaaa-aaaaa-aaaba-cai”

Building canisters…

Installing canisters…

Installing code for canister hello2, with canister\_id rrkah-fqaaa-aaaaa-aaaaq-cai

Installing code for canister hello2\_assets, with canister\_id ryjl3-tyaaa-aaaaa-aaaba-cai

Authorizing our identity (default) to the asset canister…

Uploading assets to asset canister…

Deployed canisters."  
👏

---

<div class="post-metadata">

### Author: ![Ori](https://avatars.discourse-cdn.com/v4/letter/o/ecae2f/32.png) [@Ori](https://forum.dfinity.org/u/Ori)
#### Post date: [May 15, 2021, 10:52pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/18 "2021-05-15T22:52:15Z")

</div>

The `npm run build` step is just running the command “webpack” which is what’s failing (as your posts above show). This is only used in the frontend part of the project.

(“build” is a script entry in your project’s package.json file if you want to look).

It might be worth trying another version of npm and node to see if this fixes it, something does appear to be incompatible there.

You could use nvm to manage node versions more easily.

---

<div class="post-metadata">

### Author: ![lukaskorba](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/lukaskorba/32/1723_2.png) [@lukaskorba](https://forum.dfinity.org/u/lukaskorba)
#### Post date: [May 18, 2021, 6:46am UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/19 "2021-05-18T06:46:37Z")

</div>

I have the same issue… same npm and dfx version, always fails at webpack with

TypeError: Cannot read property ‘javascript’ of undefined

Anyone has solved this issue?

btw, I’m also on macos with M1 chip, could it be related? I struggled with some other libraries (not dfinity related) to build successfully

---

<div class="post-metadata">

### Author: ![claudio](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/claudio/32/322_2.png) [@claudio](https://forum.dfinity.org/u/claudio)
#### Post date: [May 18, 2021, 6:58am UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/20 "2021-05-18T06:58:50Z")

</div>

Not an npm expert but did you do ‘npm install’ (perhaps after ‘npm update’ )

---

<div class="post-metadata">

### Author: ![lukaskorba](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/lukaskorba/32/1723_2.png) [@lukaskorba](https://forum.dfinity.org/u/lukaskorba)
#### Post date: [May 18, 2021, 12:33pm UTC](https://forum.dfinity.org/t/dfx-deploy-failed/3741/21 "2021-05-18T12:33:31Z")

</div>

yes, unfortunately it didn’t help

[Next page](https://forum.dfinity.org/t/dfx-deploy-failed/3741.md?page=2)
