cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NewcombR
Advocate IV
Advocate IV

PCF - pcf-scripts - Cannot find module "Typescript"

I went to create a new PCF project today, as a project has a requirement that I'd like to meet with a new component.

 

Receiving an error message when running pcf-scripts build.

 

 Executing task: npm run build <


> pcf-project@1.0.0 build C:\Users\NewcombR\source\repos\CSA\CSAPcf\PurchaseOrderAmountSummary
> pcf-scripts build

internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module 'typescript'
Require stack:
- C:\Users\NewcombR\source\repos\CSA\CSAPcf\PurchaseOrderAmountSummary\node_modules\pcf-scripts\manifestTypesGenerator.js
- C:\Users\NewcombR\source\repos\CSA\CSAPcf\PurchaseOrderAmountSummary\node_modules\pcf-scripts\tasks\manifestTypesTask.js
- C:\Users\NewcombR\source\repos\CSA\CSAPcf\PurchaseOrderAmountSummary\node_modules\pcf-scripts\taskGroup.js
- C:\Users\NewcombR\source\repos\CSA\CSAPcf\PurchaseOrderAmountSummary\node_modules\pcf-scripts\bin\pcf-scripts.js     
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (C:\Users\NewcombR\source\repos\CSA\CSAPcf\PurchaseOrderAmountSummary\node_modules\pcf-scripts\manifestTypesGenerator.js:6:12)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Module.require (internal/modules/cjs/loader.js:974:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\NewcombR\\source\\repos\\CSA\\CSAPcf\\PurchaseOrderAmountSummary\\node_modules\\pcf-scripts\\manifestTypesGenerator.js',
    'C:\\Users\\NewcombR\\source\\repos\\CSA\\CSAPcf\\PurchaseOrderAmountSummary\\node_modules\\pcf-scripts\\tasks\\manifestTypesTask.js',
    'C:\\Users\\NewcombR\\source\\repos\\CSA\\CSAPcf\\PurchaseOrderAmountSummary\\node_modules\\pcf-scripts\\taskGroup.js',
    'C:\\Users\\NewcombR\\source\\repos\\CSA\\CSAPcf\\PurchaseOrderAmountSummary\\node_modules\\pcf-scripts\\bin\\pcf-scripts.js'
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pcf-project@1.0.0 build: `pcf-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pcf-project@1.0.0 build 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!     C:\Users\NewcombR\AppData\Roaming\npm-cache\_logs\2021-08-03T14_40_15_738Z-debug.log
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command npm run build" terminated with exit code: 1.

 

 

I created a second, PCF project and the results were the same.

 

I opened an existing PCF project and the build script worked as expected.

 

Is there I can "undo" the update that I installed this morning?  If not, what can I do to work through the issue?

11 REPLIES 11
DavidJen
Microsoft
Microsoft

@JvdSchelling the error spew you pasted is missing all the other logging info, before the "webpack compiled with 1 error" message appears. Can you share the more complete log from the beginning, right after you entered `npm run build` ?

 

 

JvdSchelling
Frequent Visitor

Hi DevidJen,

This is the complete error log:

[09:24:00] [build] Initializing...
[09:24:00] [build] Validating manifest...
[09:24:00] [build] Validating control...
[09:24:02] [build] Running ESLint...
[09:24:03] [build] Generating manifest types...
[09:24:03] [build] Generating design types...
[09:24:03] [build] Compiling and bundling control...
[Webpack stats]:
asset bundle.js 4.74 KiB [compared for emit] (name: main)
./PCFDemoCtrl/index.ts 39 bytes [not cacheable] [built] [code generated] [1 error]

ERROR in ./PCFDemoCtrl/index.ts
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Cannot find module 'ajv/dist/compile/codegen'
Require stack:
- C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\ajv-keywords\dist\definitions\typeof.js
- C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\ajv-keywords\dist\keywords\typeof.js
- C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\ajv-keywords\dist\keywords\index.js
- C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\ajv-keywords\dist\index.js
- C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\schema-utils\dist\validate.js
- C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\schema-utils\dist\index.js
- C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\babel-loader\lib\index.js
- C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\loader-runner\lib\loadLoader.js
- C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\loader-runner\lib\LoaderRunner.js
- C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\webpack\lib\NormalModule.js
- C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\webpack\lib\ModuleFilenameHelpers.js
- C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\esbuild-loader\dist\minify-plugin.js
- C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\esbuild-loader\dist\index.js
- C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\pcf-scripts\webpackConfig.js
- C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\pcf-scripts\tasks\compileTask.js
- C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\pcf-scripts\taskGroup.js
- C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\pcf-scripts\bin\pcf-scripts.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at Module.patchedRequire [as require] (C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\diagnostic-channel\dist\src\patchRequire.js:16:46)
at require (internal/modules/cjs/helpers.js:101:18)
at Object.<anonymous> (C:\Users\J.vanderSchelling\Downloads\PCF\controls\PCFDemo\node_modules\ajv-keywords\dist\definitions\typeof.js:3:19)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)

webpack 5.75.0 compiled with 1 error in 416 ms
[pcf-scripts] [Error] encountered unexpected error:
Error: An error occurred compiling or bundling the control.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pcf-project@1.0.0 build: `pcf-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pcf-project@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Users online (2,202)