If you are new to Power Apps Component Framework (PCF), please read PCF – Beginner guide

While building a PCF project I received from my colleague, the build failed with the following MODULE_NOT_FOUND error.

I tried installing the missing package using both npm install and npm install shallow-clone@3.0.1 –save commands, but had no luck..

The following approach worked for me:

  • Delete the problematic node module. In my case the module is shallow-clone
Remove-Item -Recurse -Force node_modules\shallow-clone
  • Clear Cache
npm cache clean --force
  • Reinstall the package
npm install shallow-clone@3.0.1 --save
  • Build the project again
npm run build

The build will run successfully.

If there are too many packages with similar issues, you can try deleting all the packages and reinstalling them using these commands:

Remove-Item -Recurse -Force node_modules
Remove-Item package-lock.json
npm install

🙂

Advertisements
Advertisements

Leave a comment