web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

PCF control development setup

(1) ShareShare
ReportReport
Posted on by 10

Hi Everyone, I've been trying to learn how to develop PCF controls and I've run into a roadblock... I've installed the latest version of Node.js, the latest CLI, Visual Studio Code and .net framework 4.6.2  targeting pack. The issue I am having is that for every tutorial I try, I get the same result... a build failure with code: -4058. I have no clue where to start troubleshooting where the error lies, I look at the logs and cannot figure out how to fix this. Has anyone ever faced this?

I have the same question (0)
  • Hiken Profile Picture
    15 on at
    RE: PCF control development setup

    Hello Marc,

    You can try this tutorial, it explains step by step how to setup everything to create a PCF.

    dynamics-chronicles.com/.../deep-dive-pcf-powerapp-control-framework-step-step-tuto

    Enjoy

  • Marc Villeneuve Profile Picture
    10 on at
    RE: PCF control development setup

    Hi Kokulan, thank you for your suggestion I tried npm install -g and still no luck... Yesterday, I re-installed everything yesterday and still the same issue so I suspect it has something to do with my workstation and / or profile on this machine. Like I mentioned, I use another workstation in the office on which I installed all of the required software and it works like a charm so I won't loose any sleep over it.

    Cheers!

  • Kokulan Profile Picture
    18,054 on at
    RE: PCF control development setup

    Hi

    I had a similar error recently and doing npm install -g sorted my issue.

    Thanks

  • Suggested answer
    Marc Villeneuve Profile Picture
    10 on at
    RE: PCF control development setup

    Hello Ana / Samira, first of all thank you for trying to help. I have sort of found the issue... it's my software installation. I've installed all of the applications on my remote workstation in the office and was able to create a successful build. I guess now my course of action will be to wipe out all of the associated programs on my local pc and try again, if that does not work, at least I have an alternative working environment.

  • Marc Villeneuve Profile Picture
    10 on at
    RE: PCF control development setup

    Hi Ana, moved the work space over to my profile but it still didn't work... it was worth a try though.

  • Ana Almeida Profile Picture
    on at
    RE: PCF control development setup

    Hello Marc,

    Can you change the location of the PCF C:\vs_workspace\PCF\CopyToClipboard to c:\users\<username>\vs_workspace\PCF\CopyToClipboard?

  • Marc Villeneuve Profile Picture
    10 on at
    RE: PCF control development setup

    Hi Ana, thanks for your reply, I have tried clearing the cache as the post suggested and this did not work, I have tried deleting all of the generated files and start from scratch and still no luck. I suspect it's a path issue of some sort but I have no way of debugging the scripts to see where exactly it is failing which is quite disheartening.

  • Ana Almeida Profile Picture
    on at
    RE: PCF control development setup

    Hello Marc,

    I found a similar situation reported here: stackoverflow.com/.../npm-err-code-elifecycle

    Let me know if some of the suggestions works for you.

  • Marc Villeneuve Profile Picture
    10 on at
    RE: PCF control development setup

    I suspect it it my environment setup.

  • Marc Villeneuve Profile Picture
    10 on at
    RE: PCF control development setup

    I too was able to set up the applications, the issue that I am facing is in building the application:

    pastedimage1590527347901v2.png

    Here's the log it generates (removed the path to shorten)

    0 info it worked if it ends with ok
    1 verbose cli [
    1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
    1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
    1 verbose cli 'run',
    1 verbose cli 'build'
    1 verbose cli ]
    2 info using npm@6.14.4
    3 info using node@v12.17.0
    4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
    5 info lifecycle pcf-project@1.0.0~prebuild: pcf-project@1.0.0
    6 info lifecycle pcf-project@1.0.0~build: pcf-project@1.0.0
    7 verbose lifecycle pcf-project@1.0.0~build: unsafe-perm in lifecycle true
    8 verbose lifecycle pcf-project@1.0.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;...
    9 verbose lifecycle pcf-project@1.0.0~build: CWD: C:\vs_workspace\PCF\CopyToClipboard
    10 silly lifecycle pcf-project@1.0.0~build: Args: [ '-c', 'pcf-scripts build' ]
    11 info lifecycle pcf-project@1.0.0~build: Failed to exec build script
    12 silly lifecycle pcf-project@1.0.0~build: Returned: code: -4058 signal: null
    13 info lifecycle pcf-project@1.0.0~build: Failed to exec build script
    14 verbose stack Error: pcf-project@1.0.0 build: `pcf-scripts build`
    14 verbose stack spawn bash ENOENT
    14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    14 verbose stack at onErrorNT (internal/child_process.js:469:16)
    14 verbose stack at processTicksAndRejections (internal/process/task_queues.js:84:21)
    15 verbose pkgid pcf-project@1.0.0
    16 verbose cwd C:\vs_workspace\PCF\CopyToClipboard
    17 verbose Windows_NT 10.0.17763
    18 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
    19 verbose node v12.17.0
    20 verbose npm v6.14.4
    21 error code ELIFECYCLE
    22 error syscall spawn bash
    23 error file bash
    24 error path bash
    25 error errno ENOENT
    26 error pcf-project@1.0.0 build: `pcf-scripts build`
    26 error spawn bash ENOENT
    27 error Failed at the pcf-project@1.0.0 build script.
    27 error This is probably not a problem with npm. There is likely additional logging output above.
    28 verbose exit [ 1, true ]

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
DAnny3211 Profile Picture

DAnny3211 126

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 117

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 70 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans