Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Unanswered

npm install node-geocoder issue while running npm run build in type script + PCF (Powerapps Component Framework)

Posted on by 605

I have created a PCF (Powerapps Component Framework) in which I am using the GEOCODE feature. I have installed the required components using "npm install node-geocoder" and have added the below code :

let nodeGeocoder = require('node-geocoder');
 
let options = {
  provider: 'openstreetmap'
};
 
let geoCoder = nodeGeocoder(options);
geoCoder.geocode('Luray Caverns')
  .then((res)=> {
    console.log(res[0].latitude);
    console.log(res[0].longitude);
  })
  .catch((err)=> {
    console.log(err);
  });

When i build this code using "npm run build", the build fails with following error: ERROR in ./node_modules/request/lib/har.js Module not found: Error: Can't resolve 'fs' in 'D:\PCF\Demo\node_modules\request\lib'

Module not found: Error: Can't resolve 'net' in 'D:\PCF\Demo\node_modules\forever-agent' ERROR in ./node_modules/node-geocoder/lib/geocoder/agolgeocoder.js Module not found: Error: Can't resolve 'net' in 'D:\PCF\Demo\node_modules\node-geocoder\lib\geocoder'

ERROR in ./node_modules/node-geocoder/lib/geocoder/datasciencetoolkitgeocoder.js Module not found: Error: Can't resolve 'net' in 'D:\PCF\Demo\node_modules\node-geocoder\lib\geocoder'

ERROR in ./node_modules/node-geocoder/lib/geocoder/abstractgeocoder.js Module not found: Error: Can't resolve 'net' in 'D:\PCF\Demo\node_modules\node-geocoder\lib\geocoder'

Any help would be helpful.

Thanks in advance.

  • Ken Hubbard Profile Picture
    Ken Hubbard on at
    RE: npm install node-geocoder issue while running npm run build in type script + PCF (Powerapps Component Framework)

    Hello Rahul,

    I believe you would be better off opening a support case for this with our Power Apps team as this may require a debug of logging.  We will leave this post open for the community to answer as well.

    Ken Hubbard

    Dynamics Support

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans