I have the following installed on Windows 11:
Upon bulding a power apps code component with
npm run build
I get the error:
> numberbuttonselector@1.0.0 build
> pcf-scripts build
'pcf-scripts' is not recognized as an internal or external command,
operable program or batch file.
I also tried:
npm i -g
Solved! Go to Solution.
Because it's typescript you should probably just turn off the no-undef rule (see here: https://typescript-eslint.io/docs/linting/troubleshooting/#i-get-errors-from-the-no-undef-rule-about...)
Add this to you eslintrc.json file under your "no-unused-vars" rule.
'no-undef': 'off'
So you've done a global instead of a local?
So you ran:
pac pcf init --namespace [ControlNameSpace] --name [ControlName] --template [dataset OR field]
And then just:
npm install
Before you tried to build?
Hi @skoofy5
Thanks for helping. I am trying to install a code component.
fter many hours of hair-pulling, I'm now trying to install this component.
Specifically, NumberButtonSelector.
I just want to install it, I don't even dream of developing one myself.
Steps:
1- Created NumberButtonSelector folder
2- Opened foder with VSCode
3- Ran pac pcf init --namespace Nuno --name NumberButtonSelector --template field
4- Downloaded code from NumberButtonSelector into NumberButtonSelector/NumberButtonSelector folder
5- Ran npm install
6- Ran npm run build
7- Got the error "no-used-vars" which I've fixed as per your post
8- Now, I'm getting the error:
C:\Users\nuno_\Documents\NumberButtonSelector>cd NumberButtonSelector [22:58:42] [build] Validating control... [22:58:43] [build] Running ESLint... [22:58:44] [build] Failed: [pcf-1065] [Error] ESLint validation error: C:\Users\nuno_\Documents\NumberButtonSelector\NumberButtonSelector\index.ts 2:10 warning 'debug' is defined but never used no-unused-vars 3:10 warning 'timingSafeEqual' is defined but never used no-unused-vars 29:24 error 'EventListenerOrEventListenerObject' is not defined no-undef 30:22 error 'EventListenerOrEventListenerObject' is not defined no-undef 31:22 error 'EventListenerOrEventListenerObject' is not defined no-undef ✖ 5 problems (3 errors, 2 warnings)
So now the error is on NumberButtonSelector\NumberButtonSelector\index.ts
You may see this post also.
Because it's typescript you should probably just turn off the no-undef rule (see here: https://typescript-eslint.io/docs/linting/troubleshooting/#i-get-errors-from-the-no-undef-rule-about...)
Add this to you eslintrc.json file under your "no-unused-vars" rule.
'no-undef': 'off'