Artoria2e5 / PRCoords

Public Domain library for rectifying Chinese coordinates
https://artoria2e5.github.io/PRCoords/demo.html
GNU General Public License v3.0
151 stars 23 forks source link

Typo of package.json #7

Closed mrhso closed 5 years ago

mrhso commented 5 years ago

https://github.com/Artoria2e5/PRCoords/blob/master/package.json#L5

Artoria2e5 commented 5 years ago

works for me?

mrhso commented 5 years ago

Filenames are case-sensitive on Linux.

mrhso commented 5 years ago
>` const { distance, wgs_gcj, gcj_wgs, gcj_bd, bd_gcj, wgs_bd, bd_wgs, __bored__, gcj_wgs_bored, bd_gcj_bored, bd_wgs_bored } = require('prcoords');
Thrown:
Error: Cannot find module '/data/data/com.termux/files/usr/lib/node_modules/prcoords/js/PRcoords.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (internal/modules/cjs/loader.js:228:19)
    at Function.Module._findPath (internal/modules/cjs/loader.js:365:18)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:27)
    at Function.Module._load (internal/modules/cjs/loader.js:527:27)
    at Module.require (internal/modules/cjs/loader.js:681:19)
    at require (internal/modules/cjs/helpers.js:16:16) {
  code: 'MODULE_NOT_FOUND',
  path: '/data/data/com.termux/files/usr/lib/node_modules/prcoords/package.json',
  requestPath: 'prcoords'
}
Artoria2e5 commented 5 years ago

do you mind showing me what find /data/data/com.termux/files/usr/lib/node_modules/prcoords returns? because npm remove -g prcoords; npm install -g prcoords and doing the require really works on my end

mrhso commented 5 years ago
$ find /data/data/com.termux/files/usr/lib/node_modules/prcoords
/data/data/com.termux/files/usr/lib/node_modules/prcoords
/data/data/com.termux/files/usr/lib/node_modules/prcoords/package.json
/data/data/com.termux/files/usr/lib/node_modules/prcoords/LICENSE.gplv3
/data/data/com.termux/files/usr/lib/node_modules/prcoords/README.md
/data/data/com.termux/files/usr/lib/node_modules/prcoords/js
/data/data/com.termux/files/usr/lib/node_modules/prcoords/js/PRCoords.js

If I replace "main": "js/PRcoords.js", with "main": "js/PRCoords.js",, it will work.