tannerjt / AGStoShapefile

Convert ArcGIS Server Dynamic Map Service to GeoJSON and Shapefile
MIT License
213 stars 47 forks source link

ReferenceError: primordials is not defined #50

Closed lukepighetti closed 1 year ago

lukepighetti commented 3 years ago
% npx agsout --help
Need to install the following packages:
  agsout
Ok to proceed? (y) y
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'agsout@1.0.4',
npm WARN EBADENGINE   required: { node: '>=6.0 <7.0' },
npm WARN EBADENGINE   current: { node: 'v12.16.3', npm: '7.0.10' }
npm WARN EBADENGINE }
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated minimatch@1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
fs.js:35
} = primordials;
    ^

ReferenceError: primordials is not defined
    at fs.js:35:5
    at req_ (/Users/lukepighetti/.npm/_npx/399800f66f5e0528/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/Users/lukepighetti/.npm/_npx/399800f66f5e0528/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/Users/lukepighetti/.npm/_npx/399800f66f5e0528/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Module.require (internal/modules/cjs/loader.js:1019:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/Users/lukepighetti/.npm/_npx/399800f66f5e0528/node_modules/graceful-fs/graceful-fs.js:3:27)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Module.require (internal/modules/cjs/loader.js:1019:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/Users/lukepighetti/.npm/_npx/399800f66f5e0528/node_modules/fstream/lib/reader.js:4:10)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
npm ERR! code 1
npm ERR! path /Users/lukepighetti/development/apps/maine-hunting/mh_tools/assets
npm ERR! command failed
npm ERR! command sh -c agsout --help

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/lukepighetti/.npm/_logs/2020-12-30T20_42_27_391Z-debug.log
emilyrbowe commented 3 years ago

Not sure if you're still struggling with this or need a fix, but it looks like you're running a newer version of Node than what the package supports. I'd try using nvm to go to Node version >=6.0 of <7.0 like the error message suggests.

lukepighetti commented 3 years ago

Thanks for the quick fix! I won't be able to confirm if it works for me since I'm no longer using this project. I don't feel comfortable closing this issue so I'll leave that decision up to you. Thanks!

mitchell-merry commented 2 years ago

Hi, I can confirm that this fix works.

mmorley0395 commented 1 year ago

Had the same issue, confirming the fix works.

To leave a breadcrumb for anyone else lost here, here's how to install NVM. Once I had it set up, I used 6.5.0 node version and it worked.

link