2

在 NEAR 上运行GuestBook 示例yarn deploy时,会产生以下错误:

/bin/sh: asb: command not found

根据Discord 对话,这似乎也发生在使用Figment Learn NEAR 路径的人身上。

跑步

npm install asb

返回

npm WARN ERESOLVE overriding peer dependency
npm WARN Found: assemblyscript@0.17.14
npm WARN node_modules/assemblyscript
npm WARN   assemblyscript@"^0.17.3" from near-sdk-core@2.2.4
npm WARN   node_modules/near-sdk-core
npm WARN     near-sdk-core@"^2.2.4" from near-sdk-as@2.2.4
npm WARN     node_modules/near-sdk-as
npm WARN   1 more (@as-pect/cli)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer assemblyscript@"^0.13.3" from visitor-as@0.3.2
npm WARN node_modules/visitor-as
npm WARN   visitor-as@"^0.3.2" from near-sdk-core@2.2.4
npm WARN   node_modules/near-sdk-core
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/asb - Not found
npm ERR! 404 
npm ERR! 404  'asb@*' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

编辑:许多命令稍后yarn installyarn update错误似乎已迁移到缺少的asc库:

$ asb
node:internal/modules/cjs/loader:926
  throw err;
  ^

Error: Cannot find module 'assemblyscript/cli/asc'
4

2 回答 2

3

您是正确的,该asb命令的缩写asbuild(这是另一个别名命令),它是的依赖项near-sdk-as,应该与yarnor一起安装yarn install

asc, 安装为assemblyscript, 也应该存在,因为它是near-sdk-as. 所以没有被发现是可疑的。我的猜测是:

  1. 您需要先运行yarn以安装所有内容。
  2. 不知何故NODE_ENV被设置为"production",然后导致yarn只安装dependencies而不是安装devDependencies。要解决此问题,请使用NODE_ENV=or取消设置export NODE_ENV=。然后yarn再次运行。

npm我的一个抱怨yarn是你需要一个安装步骤。Rustcargo会根据需要安装依赖项。

于 2021-02-27T19:18:23.887 回答
0

我有一个类似的问题,我通过先登录到运行纱线来修复它。

第 1 步:运行near login并连接您的钱包(例如测试网或主网)

第 2 步:运行yarn以安装所有依赖项。

这应该有效......问候!

于 2022-01-18T02:16:36.537 回答