Turf: Error loading turf

Created on 27 Nov 2016  路  2Comments  路  Source: Turfjs/turf

When I try to require turf in a new project (tested on linux and windows) I am always getting this error:

module.js:338 throw err; ^ Error: Cannot find module 'turf' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:278:25) at Module.require (module.js:365:17) at require (module.js:384:17) at Object.<anonymous> (<somePath>/kmlCleanUp/kmlcleanup.js:1:74) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Function.Module.runMain (module.js:501:10)

Installed it using npm install @turf/turf --save in a fresh npm project

Most helpful comment

Does your code in kmlcleanup.js say require('turf') or require('@turf/turf')? It should say the latter.

All 2 comments

Does your code in kmlcleanup.js say require('turf') or require('@turf/turf')? It should say the latter.

shame on me - thank you! require('@turf/turf') it is!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

privateOmega picture privateOmega  路  3Comments

tsemerad picture tsemerad  路  4Comments

stebogit picture stebogit  路  5Comments

ozomer picture ozomer  路  3Comments

Spown picture Spown  路  3Comments