'"SyntaxError: Unexpected end of input" raised in near-vm folder during near-sdk-as yarn installment
When I tried to install near-sdk-as on my laptop (Intel-based macOS 10.13) with the command:
yarn add -D near-sdk-as
I got the following error:
❯ yarn add -D near-sdk-as
yarn add v1.22.17
info No lockfile found.
[1/4] 🔍 Resolving packages...
warning near-sdk-as > near-sdk-core > near-vm > binary-install > [email protected]: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
warning "near-sdk-as > near-sdk-core > @as-pect/[email protected]" has incorrect peer dependency "assemblyscript@^0.19.3".
warning "near-sdk-as > near-sdk-core > @as-pect/cli > @as-pect/[email protected]" has incorrect peer dependency "assemblyscript@^0.19.3".
warning "near-sdk-as > near-sdk-core > @as-pect/cli > @as-pect/[email protected]" has incorrect peer dependency "assemblyscript@^0.19.3".
[4/4] 🔨 Building fresh packages...
error /Users/admin/Develop/Learn-Near/NEAR-101/node_modules/near-vm: Command failed.
Exit code: 1
Command: node ./install.js
Arguments:
Directory: /Users/admin/Develop/Learn-Near/NEAR-101/node_modules/near-vm
Output:
/Users/admin/Develop/Learn-Near/NEAR-101/node_modules/follow-redirects/node_modules/debug/src/debug.js:47
hash = ((hash <
SyntaxError: Unexpected end of input
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1032:15)
at Module._compile (node:internal/modules/cjs/loader:1067:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Users/admin/Develop/Learn-Near/NEAR-101/node_modules/follow-redirects/node_modules/debug/src/node.js:14:28)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Other info: npm version: 8.3.1 yarn version: v1.22.17
Any thoughts on how to fix the error and complete the sdk installation?
Thanks!
Solution 1:[1]
Try yarn cache clean --force first, then rerun yarn.
Why? You have broken dependency files cached, so you want to clean the cache and download from scratch
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | 0xbe1 |
