简体   繁体   English

尝试在终端中使用geoproject命令时引发错误

[英]Throw error whenever attempting to use geoproject command in terminal

I keep getting the same error anytime I try to use the geoproject command. 每当我尝试使用geoproject命令时,都会出现相同的错误。

I have the latest version of node and D3 downloaded. 我已经下载了最新版本的node和D3。

error message: 错误信息:

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; tldr; Just re-install to get the new version of d3-geo-projection. 只需重新安装即可获得d3-geo-projection的新版本。

npm install -g d3-geo-projection

There's an issue for this here: https://github.com/d3/d3-geo-projection/issues/161 这里有一个问题: https : //github.com/d3/d3-geo-projection/issues/161

And there's a fix for this up on a pull request, but it hasn't gotten pulled in yet. 并针对拉取请求对此进行了修复,但尚未将其拉入。 You could wait for the fix or in the meantime you can probably just add 'require' into the same place in {global-install-location}/node_modules/d3-geo-projection/package.json 您可以等待修复,或者在此期间,您可以将'require'添加到{global-install-location} /node_modules/d3-geo-projection/package.json中的同一位置

https://github.com/d3/d3-geo-projection/pull/162/commits/43105df62b784f0645cb3d4cb0b0fa98c8924c87 https://github.com/d3/d3-geo-projection/pull/162/commits/43105df62b784f0645cb3d4cb0b0fa98c8924c87

UPDATE: It's up on 2.6, just re-install d3-geo-projection. 更新:它在2.6上启动,只需重新安装d3-geo-projection。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试从Nodejs(exec)执行命令抛出错误但在终端中工作 - Trying to execute command from Nodejs (exec) throw error but works in terminal 在终端中使用 vscode 命令 没有这样的文件或目录 - use vscode command in terminal No such file or directory 每当我在 redis 中使用 SCAN 命令时,键的数量都会减少 - Whenever i use SCAN command in redis, the number of keys decreases 如果有条件,然后在Node.js中引发错误,是否是一种好习惯? - Is it good practice to use if conditional and then throw error in nodejs? 尝试在Google Sheets API中使用“附加”时出现无效值错误 - Invalid Values error when attempting to use 'append' in google sheets API 引发错误并使用finally块发送错误代码500 - throw error and use finally block sends error code 500 尝试在JavaScript代码中使用Chartjs时出现“未定义需求”错误 - 'require is not defined' error when attempting to use chartjs in javascript code 我收到路径错误:[找不到模块] 每当我尝试在 VS Code 中运行任何与 npm 相关的命令时 - I got path error : [module not found] whenever I try to run any npm related command in VS Code 当我使用抛出新错误时,字符串中出现错误 - getting error in string when i use throw new error 我收到此错误:TypeError:每当我执行命令时都无法读取未定义的属性(读取“成员”) - i recieve this error: TypeError: Cannot read properties of undefined (reading 'members') whenever i execute command
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM