The engine "node" is incompatible with this module

Hi,

sorry for my eng,
i get this message when i try to build on netlify.

5:39:08 PM: build-image version: 5b0ab77c5e46895703390c45e86a907d4b78547b (focal)

5:39:08 PM: buildbot version: 5b0ab77c5e46895703390c45e86a907d4b78547b

5:39:08 PM: Fetching cached dependencies

5:39:08 PM: Starting to download cache of 218.2MB

5:39:09 PM: Finished downloading cache in 1.408s

5:39:09 PM: Starting to extract cache

5:39:14 PM: Finished extracting cache in 4.543s

5:39:14 PM: Finished fetching cache in 6.039s

5:39:14 PM: Starting to prepare the repo for build

5:39:14 PM: Preparing Git Reference refs/heads/test

5:39:15 PM: Parsing package.json dependencies

5:39:16 PM: Starting build script

5:39:16 PM: Installing dependencies

5:39:16 PM: Python version set to 2.7

5:39:16 PM: Started restoring cached Node.js version

5:39:17 PM: Finished restoring cached Node.js version

5:39:17 PM: v12.18.0 is already installed.

5:39:17 PM: Now using node v12.18.0 (npm v6.14.4)

5:39:17 PM: Started restoring cached build plugins

5:39:17 PM: Finished restoring cached build plugins

5:39:17 PM: Attempting Ruby version 2.7.2, read from environment

5:39:18 PM: Using Ruby version 2.7.2

5:39:18 PM: Using PHP version 8.0

5:39:18 PM: Started restoring cached corepack dependencies

5:39:18 PM: Finished restoring cached corepack dependencies

5:39:18 PM: Started restoring cached yarn cache

5:39:23 PM: Finished restoring cached yarn cache

5:39:23 PM: No yarn workspaces detected

5:39:23 PM: Started restoring cached node modules

5:39:23 PM: Finished restoring cached node modules

5:39:23 PM: Installing npm packages using Yarn version 1.22.10

5:39:23 PM: yarn install v1.22.10

5:39:23 PM: [1/5] Validating package.json…

5:39:23 PM: error iclicre@0.1.0: The engine “node” is incompatible with this module. Expected version “>=14.0.0 <20”. Got “12.18.0”

5:39:23 PM: error Found incompatible module.

5:39:23 PM: info Visit yarn install | Yarn for documentation about this command.

5:39:23 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1 (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)

5:39:23 PM: Error during Yarn install

5:39:23 PM: Build was terminated: Build script returned non-zero exit code: 1

5:39:23 PM: Failing build: Failed to build site

5:39:23 PM: Finished processing build request in 15.88s

am not a pro of node, i try to read the doc on environement variable but am not sure its the good solution.
TY for help

You need to upgrade your Node Version: Manage build dependencies | Netlify Docs

Hi, thx for the answer.

i already uppate node. when i use “node -v” command in terminal, the answer given to me is " v18.13.0" .
i may haved miss something.
when i build on netlify, it say iv got 12.18.0

@d1991 Did you read the documentation that @hrishikesh linked to?

It explains how you can ensure Netlify runs the version of node you want.

Ty for your answer,
sry i didnt see the doc @hrishikesh linked me

i read the doc, but clearly am not a pro. i understood that i have to set an environement variable NODE_VERSION but i dont know how.
When i go on netlify site in Environment variables set, it ask me a key and value but i dont know what i have to set.
i tryed with .env file but i dont know what i have to write in the file.

i dont know the simplest way to implemant environment variable.
i dont even know a way to do it.
Sorry, i guess its dumb ( and I probably am too

@d1991 You’re not dumb, everything is hard until it’s easy.

Learning to search and read the Documentation will get you a long way…

There’s a section within your Build settings in the Netlify UI which lets you set Environment Variables.

Note that you don’t HAVE to perform this with an Environment Variable, that’s just one of the ways you can do it. As per what @hrishikesh linked you could also…

Add a .node-version or .nvmrc file to the site’s base directory in your repository. This will also tell any other developer using the repository which version of Node.js it depends on.

In which case you’d just add a text file called either .node-version or .nvmrc to the Base directory of your project with the node version number you want specified in it.

ty for the time you gave.

so i add .node_version in root directory, the error is gone, Thnaks :slight_smile: but now i have an other problem… i may have to create an other topic ?

11:47:21 PM: build-image version: 5b0ab77c5e46895703390c45e86a907d4b78547b (focal)
11:47:21 PM: buildbot version: 5b0ab77c5e46895703390c45e86a907d4b78547b
11:47:22 PM: Fetching cached dependencies
11:47:22 PM: Starting to download cache of 218.2MB
11:47:23 PM: Finished downloading cache in 1.528s
11:47:23 PM: Starting to extract cache
11:47:26 PM: Finished extracting cache in 2.455s
11:47:26 PM: Finished fetching cache in 4.044s
11:47:26 PM: Starting to prepare the repo for build
11:47:26 PM: Preparing Git Reference refs/heads/test
11:47:26 PM: Parsing package.json dependencies
11:47:28 PM: Starting build script
11:47:28 PM: Installing dependencies
11:47:28 PM: Python version set to 2.7
11:47:28 PM: Started restoring cached Node.js version
11:47:29 PM: Finished restoring cached Node.js version
11:47:29 PM: Attempting Node.js version '19.6.0' from .node-version
11:47:29 PM: Downloading and installing node v19.6.0...
11:47:29 PM: Downloading https://nodejs.org/dist/v19.6.0/node-v19.6.0-linux-x64.tar.xz...
11:47:29 PM: Computing checksum with sha256sum
11:47:30 PM: Checksums matched!
11:47:32 PM: Now using node v19.6.0 (npm v9.4.0)
11:47:32 PM: Enabling Node.js Corepack
11:47:32 PM: Started restoring cached build plugins
11:47:32 PM: Finished restoring cached build plugins
11:47:32 PM: Attempting Ruby version 2.7.2, read from environment
11:47:33 PM: Using Ruby version 2.7.2
11:47:33 PM: Using PHP version 8.0
11:47:33 PM: Started restoring cached corepack dependencies
11:47:33 PM: Finished restoring cached corepack dependencies
11:47:33 PM: Started restoring cached yarn cache
11:47:35 PM: Finished restoring cached yarn cache
11:47:35 PM: Installing Yarn version 1.22.10
11:47:35 PM: Preparing yarn@1.22.10 for immediate activation...
11:47:36 PM: No yarn workspaces detected
11:47:36 PM: Started restoring cached node modules
11:47:36 PM: Finished restoring cached node modules
11:47:36 PM: Installing npm packages using Yarn version 1.22.10
11:47:36 PM: yarn install v1.22.10
11:47:36 PM: [1/4] Resolving packages...
11:47:36 PM: [2/4] Fetching packages...
11:47:45 PM: info fsevents@2.3.2: The platform "linux" is incompatible with this module.
11:47:45 PM: info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
11:47:45 PM: [3/4] Linking dependencies...
11:47:45 PM: warning " > @testing-library/user-event@7.2.1" has unmet peer dependency "@testing-library/dom@>=5".
11:47:45 PM: warning " > bootstrap@4.6.2" has unmet peer dependency "jquery@1.9.1 - 3".
11:47:45 PM: warning " > bootstrap@4.6.2" has unmet peer dependency "popper.js@^1.16.1".
11:47:45 PM: warning "react-scripts > eslint-config-react-app > eslint-plugin-flowtype@8.0.3" has unmet peer dependency "@babel/plugin-syntax-flow@^7.14.5".
11:47:45 PM: warning "react-scripts > eslint-config-react-app > eslint-plugin-flowtype@8.0.3" has unmet peer dependency "@babel/plugin-transform-react-jsx@^7.14.9".
11:47:45 PM: warning "react-scripts > react-dev-utils > fork-ts-checker-webpack-plugin@6.5.2" has unmet peer dependency "typescript@>= 2.7".
11:47:45 PM: warning "react-scripts > eslint-config-react-app > @typescript-eslint/eslint-plugin > tsutils@3.21.0" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
11:47:51 PM: [4/4] Building fresh packages...
11:47:52 PM: success Saved lockfile.
11:47:52 PM: Done in 16.25s.
11:47:52 PM: npm packages installed using Yarn
11:47:52 PM: Started restoring cached go cache
11:47:52 PM: Finished restoring cached go cache
11:47:52 PM: Installing Go version 1.14.4 (requested 1.14.4)
11:47:57 PM: go version go1.14.4 linux/amd64
11:47:57 PM: Detected 1 framework(s)
11:47:57 PM: "create-react-app" at version "5.0.1"
11:47:57 PM: Installing missing commands
11:47:57 PM: Verify run directory
11:47:57 PM: Section completed: initializing
11:47:58 PM: ​
11:47:58 PM:   Netlify Build                                                 
11:47:58 PM: ────────────────────────────────────────────────────────────────
11:47:58 PM: ​
11:47:58 PM: ❯ Version
11:47:58 PM:   @netlify/build 29.5.7
11:47:58 PM: ​
11:47:58 PM: ❯ Flags
11:47:58 PM:   baseRelDir: true
11:47:58 PM:   buildId: 63f2a6f7a542fe000858c8d8
11:47:58 PM:   deployId: 63f2a6f7a542fe000858c8da
11:47:58 PM: ​
11:47:58 PM: ❯ Current directory
11:47:58 PM:   /opt/build/repo
11:47:58 PM: ​
11:47:58 PM: ❯ Config file
11:47:58 PM:   No config file was defined: using default values.
11:47:58 PM: ​
11:47:58 PM: ❯ Context
11:47:58 PM:   production
11:47:58 PM: ​
11:47:58 PM:   1. Build command from Netlify app                             
11:47:58 PM: ────────────────────────────────────────────────────────────────
11:47:58 PM: ​
11:47:58 PM: $ CI='false' npm run build
11:47:59 PM: > iclicre@0.1.0 build
11:47:59 PM: > react-app-rewired build
11:47:59 PM: Creating an optimized production build...
11:48:01 PM: Failed to compile.
11:48:01 PM: 
11:48:01 PM: Module not found: Error: You attempted to import /opt/build/repo/node_modules/@babel/runtime/helpers/esm/slicedToArray.js which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.
11:48:01 PM: You can either move it inside src/, or add a symlink to it from project's node_modules/.
11:48:01 PM: ​
11:48:01 PM:   "build.command" failed                                        
11:48:01 PM: ────────────────────────────────────────────────────────────────
11:48:01 PM: ​
11:48:01 PM:   Error message
11:48:01 PM:   Command failed with exit code 1: CI='false' npm run build (https://ntl.fyi/exit-code-1)
11:48:01 PM: ​
11:48:01 PM:   Error location
11:48:01 PM:   In Build command from Netlify app:
11:48:01 PM:   CI='false' npm run build
11:48:01 PM: ​
11:48:01 PM:   Resolved config
11:48:01 PM:   build:
11:48:01 PM:     command: CI='false' npm run build
11:48:01 PM:     commandOrigin: ui
11:48:01 PM:     environment:
11:48:01 PM:       - NETLIFY_GRAPH_TOKEN
11:48:01 PM:       - ONEGRAPH_AUTHLIFY_TOKEN
11:48:01 PM:     publish: /opt/build/repo/build
11:48:01 PM:     publishOrigin: ui
11:48:02 PM: Caching artifacts
11:48:02 PM: Started saving node modules
11:48:02 PM: Finished saving node modules
11:48:02 PM: Started saving build plugins
11:48:02 PM: Finished saving build plugins
11:48:02 PM: Started saving corepack cache
11:48:02 PM: Finished saving corepack cache
11:48:02 PM: Started saving yarn cache
11:48:09 PM: Finished saving yarn cache
11:48:09 PM: Started saving pip cache
11:48:09 PM: Finished saving pip cache
11:48:09 PM: Started saving emacs cask dependencies
11:48:09 PM: Finished saving emacs cask dependencies
11:48:09 PM: Started saving maven dependencies
11:48:09 PM: Finished saving maven dependencies
11:48:09 PM: Started saving boot dependencies
11:48:09 PM: Finished saving boot dependencies
11:48:09 PM: Started saving rust rustup cache
11:48:09 PM: Finished saving rust rustup cache
11:48:09 PM: Started saving go dependencies
11:48:09 PM: Finished saving go dependencies
11:48:12 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:48:12 PM: Failing build: Failed to build site
11:48:12 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
11:48:12 PM: Finished processing build request in 50.27s

i may have to share my package.json. in vs code terminal i v got this message Problems loading reference ‘vscode://schemas/settings/configurationDefaults’: Unable to load schema from ‘vscode://schemas/settings/configurationDefaults’: cannot open vscode://schemas/settings/configurationDefaults. Detail: Unable to resolve text model content for resource vscode://schemas/settings/configurationDefaults.

maybe it’s related to my pb.
thx again

Hi…

I had a problem during my previous build and I was able to solve it thanks to the help of the forum, in particular by creating a node_version file in the directory. I think this problem is solved but now I have a new error message… I’m completely lost. Here my last pb

It was getting worse and worse. I ended up not even being able to run an “npm” command anymore. I had to reinstall Node etc. Now the “npm run start” command works again but I still can’t build on netlify. I’m not a pro, sorry… But it’s an important project that I can’t give up.

Deploy details

12:04:52 AM: build-image version: 832771656eb8553dfa7e316e93c18138ed69f9b1 (focal)
12:04:52 AM: buildbot version: 832771656eb8553dfa7e316e93c18138ed69f9b1
12:04:52 AM: Fetching cached dependencies
12:04:52 AM: Starting to download cache of 218.2MB
12:04:54 AM: Finished downloading cache in 2.258s
12:04:54 AM: Starting to extract cache
12:04:57 AM: Finished extracting cache in 2.105s
12:04:57 AM: Finished fetching cache in 4.431s
12:04:57 AM: Starting to prepare the repo for build
12:04:57 AM: Preparing Git Reference refs/heads/test
12:04:57 AM: Parsing package.json dependencies
12:04:58 AM: Starting build script
12:04:59 AM: Installing dependencies
12:04:59 AM: Python version set to 2.7
12:04:59 AM: Started restoring cached Node.js version
12:04:59 AM: Finished restoring cached Node.js version
12:04:59 AM: Attempting Node.js version '18.14.1' from .node-version
12:05:00 AM: Downloading and installing node v18.14.1...
12:05:00 AM: Downloading https://nodejs.org/dist/v18.14.1/node-v18.14.1-linux-x64.tar.xz...
12:05:00 AM: Computing checksum with sha256sum
12:05:00 AM: Checksums matched!
12:05:02 AM: Now using node v18.14.1 (npm v9.3.1)
12:05:02 AM: Enabling Node.js Corepack
12:05:02 AM: Started restoring cached build plugins
12:05:02 AM: Finished restoring cached build plugins
12:05:02 AM: Attempting Ruby version 2.7.2, read from environment
12:05:03 AM: Using Ruby version 2.7.2
12:05:03 AM: Using PHP version 8.0
12:05:03 AM: Started restoring cached corepack dependencies
12:05:03 AM: Finished restoring cached corepack dependencies
12:05:03 AM: No npm workspaces detected
12:05:03 AM: Started restoring cached node modules
12:05:03 AM: Finished restoring cached node modules
12:05:04 AM: Installing npm packages using npm version 9.3.1
12:05:08 AM: npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
12:05:08 AM: npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
12:05:08 AM: npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
12:05:09 AM: npm WARN deprecated @types/testing-library__dom@7.5.0: This is a stub types definition. testing-library__dom provides its own type definitions, so you do not need this installed.
12:05:11 AM: npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
12:05:18 AM: added 607 packages, removed 653 packages, changed 659 packages, and audited 1488 packages in 14s
12:05:18 AM: 234 packages are looking for funding
12:05:18 AM:   run `npm fund` for details
12:05:18 AM: 6 high severity vulnerabilities
12:05:18 AM: To address all issues (including breaking changes), run:
12:05:18 AM:   npm audit fix --force
12:05:18 AM: Run `npm audit` for details.
12:05:18 AM: npm packages installed
12:05:19 AM: Started restoring cached go cache
12:05:19 AM: Finished restoring cached go cache
12:05:19 AM: Installing Go version 1.14.4 (requested 1.14.4)
12:05:22 AM: go version go1.14.4 linux/amd64
12:05:23 AM: Detected 1 framework(s)
12:05:23 AM: "create-react-app" at version "5.0.1"
12:05:23 AM: Section completed: initializing
12:05:24 AM: ​
12:05:24 AM:   Netlify Build                                                 
12:05:24 AM: ────────────────────────────────────────────────────────────────
12:05:24 AM: ​
12:05:24 AM: ❯ Version
12:05:24 AM:   @netlify/build 29.5.8
12:05:24 AM: ​
12:05:24 AM: ❯ Flags
12:05:24 AM:   baseRelDir: true
12:05:24 AM:   buildId: 63f3fc924b92c700087d6605
12:05:24 AM:   deployId: 63f3fc924b92c700087d6607
12:05:24 AM: ​
12:05:24 AM: ❯ Current directory
12:05:24 AM:   /opt/build/repo
12:05:24 AM: ​
12:05:24 AM: ❯ Config file
12:05:24 AM:   No config file was defined: using default values.
12:05:24 AM: ​
12:05:24 AM: ❯ Context
12:05:24 AM:   production
12:05:24 AM: ​
12:05:24 AM:   1. Build command from Netlify app                             
12:05:24 AM: ────────────────────────────────────────────────────────────────
12:05:24 AM: ​
12:05:24 AM: $ CI='false' npm run build
12:05:24 AM: > iclicre@0.1.0 build
12:05:24 AM: > react-app-rewired build
12:05:25 AM: Creating an optimized production build...
12:05:28 AM: Failed to compile.
12:05:28 AM: 
12:05:28 AM: Module not found: Error: You attempted to import /opt/build/repo/node_modules/@babel/runtime/helpers/esm/slicedToArray.js which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.
12:05:28 AM: You can either move it inside src/, or add a symlink to it from project's node_modules/.
12:05:28 AM: ​
12:05:28 AM:   "build.command" failed                                        
12:05:28 AM: ────────────────────────────────────────────────────────────────
12:05:28 AM: ​
12:05:28 AM:   Error message
12:05:28 AM:   Command failed with exit code 1: CI='false' npm run build (https://ntl.fyi/exit-code-1)
12:05:28 AM: ​
12:05:28 AM:   Error location
12:05:28 AM:   In Build command from Netlify app:
12:05:28 AM:   CI='false' npm run build
12:05:28 AM: ​
12:05:28 AM:   Resolved config
12:05:28 AM:   build:
12:05:28 AM:     command: CI='false' npm run build
12:05:28 AM:     commandOrigin: ui
12:05:28 AM:     environment:
12:05:28 AM:       - NETLIFY_GRAPH_TOKEN
12:05:28 AM:       - ONEGRAPH_AUTHLIFY_TOKEN
12:05:28 AM:     publish: /opt/build/repo/build
12:05:28 AM:     publishOrigin: ui
12:05:28 AM: Caching artifacts
12:05:28 AM: Started saving node modules
12:05:28 AM: Finished saving node modules
12:05:28 AM: Started saving build plugins
12:05:28 AM: Finished saving build plugins
12:05:28 AM: Started saving corepack cache
12:05:28 AM: Finished saving corepack cache
12:05:28 AM: Started saving pip cache
12:05:28 AM: Finished saving pip cache
12:05:28 AM: Started saving emacs cask dependencies
12:05:28 AM: Finished saving emacs cask dependencies
12:05:28 AM: Started saving maven dependencies
12:05:28 AM: Finished saving maven dependencies
12:05:28 AM: Started saving boot dependencies
12:05:28 AM: Finished saving boot dependencies
12:05:28 AM: Started saving rust rustup cache
12:05:28 AM: Finished saving rust rustup cache
12:05:28 AM: Started saving go dependencies
12:05:28 AM: Finished saving go dependencies
12:05:30 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:05:30 AM: Failing build: Failed to build site
12:05:30 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
12:05:30 AM: Finished processing build request in 38.101s

TY for the time you gave to me

Hi @d1991 :wave:t6: Can you address this?

5:05:18 PM: To address all issues (including breaking changes), run:
5:05:18 PM:   npm audit fix --force
5:05:18 PM: Run `npm audit` for details

Hi
ty for your answer, @SamO
sry i can only work on this the week end.

i try npm audit fix --force and now nothing work on local…

    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (C:\Users\33644\OneDrive\Bureau\siteweb\refonte\node_modules\webpack\lib\util\createHash.js:90:53)
    at NormalModule._initBuildHash (C:\Users\33644\OneDrive\Bureau\siteweb\refonte\node_modules\webpack\lib\NormalModule.js:386:16)       
    at C:\Users\33644\OneDrive\Bureau\siteweb\refonte\node_modules\webpack\lib\NormalModule.js:418:10
    at C:\Users\33644\OneDrive\Bureau\siteweb\refonte\node_modules\webpack\lib\NormalModule.js:293:13
    at C:\Users\33644\OneDrive\Bureau\siteweb\refonte\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at C:\Users\33644\OneDrive\Bureau\siteweb\refonte\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (C:\Users\33644\OneDrive\Bureau\siteweb\refonte\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at C:\Users\33644\OneDrive\Bureau\siteweb\refonte\node_modules\babel-loader\lib\index.js:51:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.14.1

plz help me… really am down

Hi @d1991,

Your build log mentions the error fairly well: Netlify App

9:07:28 PM: Module not found: Error: You attempted to import /opt/build/repo/node_modules/@babel/runtime/helpers/esm/slicedToArray.js which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.

9:07:28 PM: You can either move it inside src/, or add a symlink to it from project’s node_modules/.

You need to find what in your code needs that dependency and solve the issue. This is not a Netlify issue and we cannot help with code-level debugging. You can check out this: javascript - The create-react-app imports restriction outside of src directory - Stack Overflow

Ty for your answer,

i will try to find that. Great thx.
all of u