2

When running the GuestBook example on NEAR using yarn deploy the following error is produced:

/bin/sh: asb: command not found

This appears to be happening to people using the Figment Learn NEAR path as well, based on Discord conversations.

Running

npm install asb

returns

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.

Edit: Many yarn install and yarn update commands later, the error seems to have migrated to a missing asc library:

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

Error: Cannot find module 'assemblyscript/cli/asc'
Erik Trautman
  • 5,883
  • 2
  • 27
  • 35

3 Answers3

4

You are correct the asb command is short for asbuild (which is another alias command), which is a dependency of near-sdk-as and should be installed with yarn or yarn install.

asc, installed as assemblyscript, should also be present because it is a dependency of near-sdk-as. So it not being found is suspicious. My guesses are:

  1. You need to run yarn first to install everything.
  2. Somehow NODE_ENV was set to be "production", which then causes yarn to install only dependencies and not devDependencies. To fix this unset it with NODE_ENV= or export NODE_ENV=. Then run yarn again.

My one complaint with npm and yarn is that you need to have an install step. Rust's cargo installs dependencies as needed.

sirwillem
  • 722
  • 4
  • 9
0

I had a similar issue and I fixed it by login first to running yarn.

step 1: run near login and connect your wallet (testnet or mainnet for instance)

step 2: run yarn to install all dependencies.

This should works... greetings!

0

In my case too, I was constantly getting this error no matter what I did;

asb: command not found

While I was just giving up hope, this command was my solution.

yarn add -D near-sdk-as
malibil
  • 163
  • 2
  • 13