question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Node 14 to "engines" for all dapps

See original GitHub issue

What is the Problem Being Solved?

In our dapps, if the Node version is below 14, we get a mysterious error message:

katesills@kates-mbp dapp-card-store-2 % agoric install
(node:65896) ExperimentalWarning: The ESM module loader is experimental.
file:///Users/katesills/code/agoric-sdk/packages/marshal/src/marshal.js:6
import { Nat } from '@agoric/nat';
         ^^^
SyntaxError: The requested module '@agoric/nat' does not provide an export named 'Nat'
    at ModuleJob._instantiate (internal/modules/esm/module_job.js:92:21)
    at async ModuleJob.run (internal/modules/esm/module_job.js:107:20)
    at async Loader.import (internal/modules/esm/loader.js:176:24)

We need to improve the error message to point users to the appropriate Node version.

Description of the Design

Add

  "engines": {
    "node": ">=14.15.0"
  },

to the package.json in the root folder of the dapps.

This gives a much better error message:

error dapp-card-store@0.0.1: The engine "node" is incompatible with this module. Expected version ">=14". Got "13.12.0"
error Commands cannot run with an incompatible environment.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Security Considerations

None

Test Plan

None

List of dapps:

  • dapp-card-store
  • dapp-treasury
  • dapp-fungible-faucet
  • testnet-load-generator
  • documentation
  • dapp-otc
  • dapp-nft-drop
  • dapp-loan
  • dapp-token-economy
  • dapp-simple-exchange
  • dapp-autoswap
  • dapp-oracle
  • dapp-pegasus

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
namangirdhar16commented, Oct 30, 2021

@katelynsills i guess i understand what needs to be done here, for the sake of confirmation i would like to ask do i just need to go in each project folder and update the package.json file with node version greater than 14?

0reactions
turadgcommented, Feb 7, 2022

Note that our minimum Node is presently 14.17.0. When we get to this we should also update other references to the required version. https://github.com/Agoric/agoric-sdk/pull/4460#issuecomment-1030422275

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can I change the version of node.js my project uses?
Yes, you can do so by updating the engines field specified in the package.json project file. Currently, Glitch supports node.js versions 6.17.1 through ......
Read more >
How To Run Multiple Versions of Node.js with ... - DigitalOcean
Step 1 — Getting Started · Step 2 — Installing Multiple Node.js Versions · Step 3 — Listing Installed Node.js Versions · Step...
Read more >
How to Install Node.js and npm on Windows, macOS, and Linux
Learn how to install Node.js and npm on your Windows, macOS, or Linux operating systems with the most straightforward step-by-step ...
Read more >
Setting up a Node.js development environment - Google Cloud
js apps that run on Google Cloud. Follow this tutorial to install Node.js and relevant tools. Objectives. Install Node Version Manager (NVM).
Read more >
Configure Node.js apps - Azure App Service - Microsoft Learn
Node.js apps must be deployed with all the required NPM dependencies. The App Service deployment engine automatically runs npm install ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found