Node.js is available in the development environment for running JavaScript tools, build processes, and applications. Both NPM and Yarn package managers are supported.
Node.js is enabled by default during setup. If needed, you can enable it manually:
mkdir -p conf/node
dev rebuildRun Node.js scripts:
dev node script.jsCheck Node.js version:
dev node --versionInstall dependencies from package.json:
dev npm installInstall a specific package:
dev npm install package-nameRun npm scripts:
dev npm run build
dev npm run watch
dev npm run devInstall dependencies:
dev yarn installAdd a package:
dev yarn add package-nameRun yarn scripts:
dev yarn build
dev yarn watchAll Node.js, NPM, and Yarn commands run in your current directory context. Make sure you're in your project directory before running commands:
cd workspace/customer/project
dev npm installFor projects using Webpack, Gulp, Grunt, or similar:
cd workspace/customer/project
dev npm install
dev npm run buildFor Magento 2 themes using Gulp or similar:
cd workspace/customer/project/htdocs
dev npm install
dev npm run buildFor development with file watching:
dev npm run watchOr with Yarn:
dev yarn watchThe environment uses the Node.js version defined in the build configuration. To check which version is available:
dev node --versionBoth NPM and Yarn are available. Choose based on your project:
- If
package-lock.jsonexists, usedev npm - If
yarn.lockexists, usedev yarn
If you encounter permission errors, the Node.js container runs as your user, so permissions should match your local files.
Ensure you've installed dependencies:
dev npm installOr:
dev yarn installClear NPM cache:
dev npm cache clean --forceClear Yarn cache:
dev yarn cache clean