![](/img/trans.png)
[英]Trying to execute command from Nodejs (exec) throw error but works in terminal
[英]Throw error whenever attempting to use geoproject command in terminal
每当我尝试使用geoproject命令时,都会出现相同的错误。
我已经下载了最新版本的node和D3。
错误信息:
Parkers-MacBook-Pro-2:proj parkerbarton$ geoproject
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module 'resolve'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/usr/local/lib/node_modules/d3-geo-projection/bin/resolve.js:2:15)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
tldr; 只需重新安装即可获得d3-geo-projection的新版本。
npm install -g d3-geo-projection
这里有一个问题: https : //github.com/d3/d3-geo-projection/issues/161
并针对拉取请求对此进行了修复,但尚未将其拉入。 您可以等待修复,或者在此期间,您可以将'require'添加到{global-install-location} /node_modules/d3-geo-projection/package.json中的同一位置
https://github.com/d3/d3-geo-projection/pull/162/commits/43105df62b784f0645cb3d4cb0b0fa98c8924c87
更新:它在2.6上启动,只需重新安装d3-geo-projection。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.