different node version conflicts while npm install - node.js

I got this issue everytime I want to do npx create-react-app my_app
yarn add v1.15.2
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
error eslint#6.2.1: The engine "node" is incompatible with this module.
Expected version "^8.10.0 || ^10.13.0 || >=11.10.1". Got "8.3.0"
But when I do check my versions with nvm and bash here's what I got
$ node -v
v8.16.1
$ npm -v
6.4.1
$ nvm ls
nvm ls
-> v8.16.1
v9.10.1
v12.0.0
system
default -> node (-> v12.0.0)
node -> stable (-> v12.0.0) (default)
stable -> 12.0 (-> v12.0.0) (default)
iojs -> N/A (default)
lts/* -> lts/dubnium (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.16.1
lts/dubnium -> v10.16.3 (-> N/A)
I really don't get why it says while doing the npx command that I got node 8.3.0 and that version appears nowhere
It may be because I've installed node with brew some times ago and it may conflict with nvm settings?
It works when I issue npm install -g create-react-app and create-react-app my-app separately as it's what facebook recommends for old node version
$ npm install -g create-react-app
+ create-react-app#3.1.1
added 91 packages from 45 contributors in 4.491s
$ create-react-app trainin
yarn add v1.15.2
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
warning "react-scripts > #typescript-eslint/eslint-plugin#1.13.0" has incorrect peer dependency "eslint#^5.0.0".
warning "react-scripts > #typescript-eslint/parser#1.13.0" has incorrect peer dependency "eslint#^5.0.0".
warning "react-scripts > #typescript-eslint/eslint-plugin > tsutils#3.17.1" 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".
[4/4] 🔨 Building fresh packages...
success Saved lockfile.
success Saved 7 new dependencies.
info Direct dependencies
├─ react-dom#16.9.0
├─ react-scripts#3.1.1
└─ react#16.9.0
info All dependencies
├─ eslint-config-react-app#5.0.1
├─ react-dev-utils#9.0.3
├─ react-dom#16.9.0
├─ react-error-overlay#6.0.1
├─ react-scripts#3.1.1
├─ react#16.9.0
└─ scheduler#0.15.0
✨ Done in 15.45s.

You'd better uninstall the version installed by brew, and setup the default version compatible with npx required.

You can use n package which allow you to switch between multiple node versions

Related

npx create-react-app my-app stuck after installing packages

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
yarn add v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#1.2.13: The platform "win32" is incompatible with this module.
info "fsevents#1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.3.2: The platform "win32" is incompatible with this module.
info "fsevents#2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "react-scripts > #typescript-eslint/eslint-plugin > tsutils#3.20.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".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 7 new dependencies.
info Direct dependencies
├─ cra-template#1.1.2
├─ react-dom#17.0.2
├─ react-scripts#4.0.3
└─ react#17.0.2
info All dependencies
├─ cra-template#1.1.2
├─ immer#8.0.1
├─ react-dev-utils#11.0.4
├─ react-dom#17.0.2
├─ react-scripts#4.0.3
├─ react#17.0.2
└─ scheduler#0.20.2
Done in 368.65s.
create-react-app stuck after this. Even after I manually terminated the Job and executed the command "npm start" still not working.
any fixes for this problem ?
One possible option is to try using npm instead of yarn.
npx create-react-app my-app --use-npm

Dockerfile with React app not working with "create-react-app ." command in RUN section

I'm trying to build a Dockerfile with a node and install ReactJS there:
FROM node
WORKDIR /home/node/app
RUN npm install -g create-react-app
RUN create-react-app .
CMD npm start
During the build, the following errors occur, and the corresponding files do not appear in the volume:
Creating a new React app in /home/node/app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
yarn add v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#1.2.13: The platform "linux" is incompatible with this module.
info "fsevents#1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.2.1: The platform "linux" is incompatible with this module.
info "fsevents#2.2.1" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.1.3: The platform "linux" is incompatible with this module.
info "fsevents#2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.3.1: The platform "linux" is incompatible with this module.
info "fsevents#2.3.1" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "react-scripts > #typescript-eslint/eslint-plugin > tsutils#3.17.1" 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".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 6 new dependencies.
info Direct dependencies
├─ cra-template#1.1.1
├─ react-dom#17.0.1
├─ react-scripts#4.0.1
└─ react#17.0.1
info All dependencies
├─ cra-template#1.1.1
├─ react-dev-utils#11.0.1
├─ react-dom#17.0.1
├─ react-scripts#4.0.1
├─ react#17.0.1
└─ scheduler#0.20.1
Done in 49.74s.
Initialized a git repository.
Installing template dependencies using yarnpkg...
yarn add v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#2.3.1: The platform "linux" is incompatible with this module.
info "fsevents#2.3.1" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#1.2.13: The platform "linux" is incompatible with this module.
info "fsevents#1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.2.1: The platform "linux" is incompatible with this module.
info "fsevents#2.2.1" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.1.3: The platform "linux" is incompatible with this module.
info "fsevents#2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "react-scripts > #typescript-eslint/eslint-plugin > tsutils#3.17.1" 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".
warning " > #testing-library/user-event#12.6.2" has unmet peer dependency "#testing-library/dom#>=7.21.4".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 17 new dependencies.
info Direct dependencies
├─ #testing-library/jest-dom#5.11.9
├─ #testing-library/react#11.2.3
├─ #testing-library/user-event#12.6.2
├─ react-dom#17.0.1
├─ react#17.0.1
└─ web-vitals#0.2.4
info All dependencies
├─ #testing-library/dom#7.29.4
├─ #testing-library/jest-dom#5.11.9
├─ #testing-library/react#11.2.3
├─ #testing-library/user-event#12.6.2
├─ #types/aria-query#4.2.1
├─ #types/jest#26.0.20
├─ #types/testing-library__jest-dom#5.9.5
├─ css.escape#1.5.1
├─ css#3.0.0
├─ dom-accessibility-api#0.5.4
├─ lz-string#1.4.4
├─ min-indent#1.0.1
├─ react-dom#17.0.1
├─ react#17.0.1
├─ redent#3.0.0
├─ strip-indent#3.0.0
└─ web-vitals#0.2.4
Done in 10.61s.
Removing template package using yarnpkg...
yarn remove v1.22.5
[1/2] Removing module cra-template...
[2/2] Regenerating lockfile and installing missing dependencies...
info fsevents#2.3.1: The platform "linux" is incompatible with this module.
info "fsevents#2.3.1" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#1.2.13: The platform "linux" is incompatible with this module.
info "fsevents#1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.2.1: The platform "linux" is incompatible with this module.
info "fsevents#2.2.1" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.1.3: The platform "linux" is incompatible with this module.
info "fsevents#2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
warning " > #testing-library/user-event#12.6.2" has unmet peer dependency "#testing-library/dom#>=7.21.4".
warning "react-scripts > #typescript-eslint/eslint-plugin > tsutils#3.17.1" 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".
success Uninstalled packages.
Done in 10.09s.
Git commit not created Error: Command failed: git commit -m "Initialize project using Create React App"
at checkExecSyncError (node:child_process:682:11)
at execSync (node:child_process:719:15)
at tryGitCommit (/home/node/app/node_modules/react-scripts/scripts/init.js:62:5)
at module.exports (/home/node/app/node_modules/react-scripts/scripts/init.js:352:25)
at [eval]:3:14
at Script.runInThisContext (node:vm:134:12)
at Object.runInThisContext (node:vm:311:38)
at node:internal/process/execution:77:19
at [eval]-wrapper:6:22
at evalScript (node:internal/process/execution:76:60) {
status: 128,
signal: null,
output: [ null, null, null ],
pid: 153,
stdout: null,
stderr: null
}
Removing .git directory...
Success! Created app at /home/node/app
But if I transfer the command create-react-app . to the CMD section, the Dockerfile will be successfully built, but the next time the docker-container is started, there will be an error, since CMD executes the command every time it starts and tries to install the React.
How to make a container with Node correctly and install a ReactJS there?

Why when im installing react app, it gives me this error?

So I don't know what's going with my computer, everyone I ask is saying this is strange and they never seen it before so I hoping someone here can help me before i just buy another computer lol...jk
This screenshot you see here is what happens after i run "npm create-react-app
idk why it just stays there and it only gives three files instead of giving me all the file i need for the react app (like public, SRC).
If someone sends me the folder with all the correct files Im able to run the react app and work on it, the issue is that Im not being able to create for some reason and my OCD is really killing me on this.
Please and thank you! :)
$ npx create-react-app myapp13
Creating a new React app in C:\Users\joesa\Desktop\myapp13.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
yarn add v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#1.2.12: The platform "win32" is incompatible with this module.
info "fsevents#1.2.12" is an optional dependency and failed compatibility check.
Excluding it from installation.
info fsevents#2.1.2: The platform "win32" is incompatible with this module.
info "fsevents#2.1.2" is an optional dependency and failed compatibility check.
Excluding it from installation.
[3/4] Linking dependencies...
warning "react-scripts > #typescript-eslint/eslint-plugin > tsutils#3.17.1" 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".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 14 new dependencies.
info Direct dependencies
├─ cra-template#1.0.3
├─ react-dom#16.13.1
├─ react-scripts#3.4.1
└─ react#16.13.1
info All dependencies
├─ #babel/plugin-syntax-typescript#7.10.1
├─ #babel/plugin-transform-flow-strip-types#7.9.0
├─ #babel/plugin-transform-runtime#7.9.0
├─ #babel/plugin-transform-typescript#7.10.1
├─ #babel/preset-typescript#7.9.0
├─ babel-preset-react-app#9.1.2
├─ cra-template#1.0.3
├─ eslint-config-react-app#5.2.1
├─ react-dev-utils#10.2.1
├─ react-dom#16.13.1
├─ react-error-overlay#6.0.7
├─ react-scripts#3.4.1
├─ react#16.13.1
└─ scheduler#0.19.1
Done in 12.46s.
Here you go: https://drive.google.com/drive/folders/1J-z39UQdqV5GP096TDs70m-WzJRiq_bY?usp=sharing
Make sure to run npm install
Try this:
npm uninstall -g create-react-app
npm install -g create-react-app#latest
npx create-react-app testApp

How to install Gulp.js v4 globally with Yarn?

I installed Gulp.js globally with Yarn:
$ yarn global add gulp --no-bin-links
yarn global v1.17.3
[1/4] Resolving packages...
warning gulp > glob-watcher > anymatch > micromatch > snapdragon > source-map-resolve > urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
warning gulp > glob-watcher > anymatch > micromatch > snapdragon > source-map-resolve > resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
[2/4] Fetching packages...
info fsevents#1.2.12: The platform "linux" is incompatible with this module.
info "fsevents#1.2.12" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "gulp#4.0.2" with binaries:
- gulp
Done in 5.76s.
$ yarn global add gulp-cli --no-bin-links
yarn global v1.17.3
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#1.2.12: The platform "linux" is incompatible with this module.
info "fsevents#1.2.12" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "gulp-cli#2.2.0" with binaries:
- gulp
Done in 1.60s.
(I'm using the --no-bin-links parameter to avoid this error: error An unexpected error occurred: "EPROTO: protocol error, symlink '../../../semver/bin/semver' -> '/path/to/project/public/components/accord/node_modules/.bin/semver'".)
The yarn global list provides the expected output:
$ yarn global list
yarn global v1.17.3
info "gulp#4.0.2" has binaries:
- gulp
info "gulp-cli#2.2.0" has binaries:
- gulp
Done in 0.53s.
But when I now execute gulp, old versions (Gulp 3.9.1 and Gulp CLI 2.2.0 are used:
$ gulp -v
CLI version: 2.2.0
Local version: 3.9.1
What is wrong here and how to install the required Gulp version globally correctly with Yarn and make this version be used?

create-react-app > error css-loader#1.0.0: The engine "node" is incompatible with this module. Expected version ">= 6.9.0 <7.0.0 || >= 8.9.0"

I'm unable to npm init react-app my-app or npx create-react-app my-app even if I have node -v v8.2.1. My console output:
> [1/4] 🔍 Resolving packages... [2/4] 🚚 Fetching packages... error
> css-loader#1.0.0: The engine "node" is incompatible with this module.
> Expected version ">= 6.9.0 <7.0.0 || >= 8.9.0". error Found
> incompatible module info Visit https://yarnpkg.com/en/docs/cli/add for
> documentation about this command.
I tried to remove css-loader or install the last version of the package. Any help would be greatly appreciated.
You need node version above of 8.9.0 or between 6.9.0 to 7

Resources