ENOSYS: function not implemented - npm

I recently install next js use to npm in raspi 4 with the raspbian operating system. Every time when I install react js, next js, and gatsby show me the same error.
At this time I install nextjs use yarn. also, I use npm and npx to show the same error. so I started to find a solution then somebody told me to use sudo so I use sudo but doesn't work
sudo yarn create next-app
check my code error output
pi#raspberrypi:/media/pi/8243-BE00/next $ sudo yarn create next-app
yarn create v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-next-app#10.0.5" with binaries:
- create-next-app
✔ What is your project named? … myapp
Creating a new Next.js app in /media/pi/8243-BE00/next/myapp.
Installing react, react-dom, and next using yarn...
yarn add v1.22.10
info No lockfile found.
[1/4] Resolving packages...
warning next > chokidar > fsevents#2.1.3: "Please update to latest v2.3 or v2.2"
warning next > webpack > watchpack > watchpack-chokidar2 > chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning next > webpack > watchpack > watchpack-chokidar2 > chokidar > fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning next > resolve-url-loader > rework > css > urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
warning next > resolve-url-loader > rework > css > source-map-resolve > urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
warning next > resolve-url-loader > rework > css > source-map-resolve > resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
[2/4] Fetching packages...
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.
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.
[3/4] Linking dependencies...
error An unexpected error occurred: "ENOSYS: function not implemented, symlink '../../../../terser/bin/terser' -> '/media/pi/8243-BE00/next/myapp/node_modules/#ampproject/toolbox-optimizer/node_modules/.bin/terser'".
info If you think this is a bug, please open a bug report with the information provided in "/media/pi/8243-BE00/next/myapp/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom next --cwd /media/pi/8243-BE00/next/myapp has failed.
Done in 293.09s.
pi#raspberrypi:/media/pi/8243-BE00/next $

You can try this next:
Remove yarn.lock.
Remove node_modules.
Use the --ignore-optional FLAG (yarn --ignore-optional); these don’t install optional dependencies.
The fsevents package is for macOS only; you don't need it in Linux.
If any of that works you can remove ignore and see if .yarnclean works.

Based on the log, looks like script is not able to create symbolic link
"ENOSYS: function not implemented, symlink '../../../../terser/bin/terser' -> '/media/pi/8243-BE00/next/myapp/node_modules/#ampproject/toolbox-optimizer/node_modules/.bin/terser'".
What is the file system you are using? I know exFAT and FAT32 don't support symbolic link.
Reference: https://learn.microsoft.com/en-us/windows/win32/fileio/filesystem-functionality-comparison

Related

Error running npx to create a react-native project

I'm trying to create a new project with typescript template using npx like this
npx react-native init AwesomeTSProject --template react-native-template-typescript
It creates the folder but it shows me this error
✔ Downloading template
✔ Copying template
✔ Processing template
✖ Installing dependencies
error Error: Command failed: yarn install
warning react-native > #react-native-community/cli-platform-ios > xcode > uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning react-native > #react-native-community/cli > #react-native-community/cli-plugin-metro > metro > jest-haste-map > sane#4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
warning react-native > #react-native-community/cli > #react-native-community/cli-plugin-metro > metro > metro-minify-uglify > uglify-es#3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
warning react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > source-map-resolve#0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
warning react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > source-map-resolve > resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
warning react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > source-map-resolve > urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
warning react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > source-map-resolve > source-map-url#0.4.1: See https://github.com/lydell/source-map-url#deprecated
warning #react-native-community/eslint-config > babel-eslint#10.1.0: babel-eslint is now #babel/eslint-parser. This package will no longer receive updates.
error #typescript-eslint/eslint-plugin#5.12.1: The engine "node" is incompatible with this module. Expected version "^12.22.0 || ^14.17.0 || >=16.0.0". Got "15.14.0"
error Found incompatible module.
yarn install v1.22.17
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
I've checked both https://yarnpkg.com/en/docs/cli/install & https://v8.dev/blog/math-random but can't find the issue, I've checked over here in Stack Overflow but didn't find anything.
In my case upgrading the node version solved the issue.
In my case run this command
npx react-native init YourProjectHere --template react-native-template-typescript --npm
I am running ZORIN OS(UBUNTU) so after adding sudo did job for me.
sudo npx react-native init ProjectName
I had the same issue where my yarn version was 3.2.0
Then I did reset it to yarn set version 1.22.1 and it worked well my node version is 18

How to resolve yarn warnings

I created a new project with the vue cli.
This project is a Vue3 with Ant Design, Vue Router and Eslint.
However when I give the yarn command it shows me the following warnings.
yarn install v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
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.
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.
[3/4] Linking dependencies...
warning "#vue/eslint-config-airbnb > eslint-import-resolver-webpack#0.13.0" has unmet peer dependency "webpack#>=1.11.0".
warning " > less-loader#7.3.0" has unmet peer dependency "webpack#^4.0.0 || ^5.0.0".
[4/4] Building fresh packages...
Done in 26.91s.
The webpack I noticed is already installed directly on vue 3. How do I resolve these warnings?
for fsevents it seems that it's a MacOS-only library so that might explain why you got the first error.
for peer dependencies and webpack if you are using Yarn it seems that you have to do yarn add webpack --peer or as #kaumadie said in a comment you can also add it directly on the package.json file of your project
With npm, you can do npm i directly in the project's folder and it should resolve all peer dependencies automatically
Hope it helped you, and have a good day !

command yarn create react-app issues engine and module

I am trying to create-react-app with typescript as I have done many times to start a new project. It says I have a missing module so I updated my brew, updated yarn, updated node, I see the issue with the engine not compatible with the module but I am not sure how to update the engine either if It deletes everything
stephens-MacBook-Pro:MobX stephen$ yarn create react-app mobx_course --template typescript
yarn create v1.22.10
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
warning Pattern ["object-assign#latest"] is trying to unpack in the same destination "/Users/stephen/Library/Caches/Yarn/v6/npm-object-assign-4.1.1-2109adc7965887cfc05cbbd442cac8bfbb360863-integrity/node_modules/object-assign" as pattern ["object-assign#^4.1.0","object-assign#^4"]. This could result in non-deterministic behavior, skipping.
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
success Installed "create-react-app#4.0.1" with binaries:
- create-react-app
Creating a new React app in /Users/stephen/Desktop/MobX/mobx_course.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template-typescript...
yarn add v1.22.10
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
error browserslist#4.14.7: The engine "node" is incompatible with this module. Expected version "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7". Got "13.5.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts cra-template-typescript --cwd /Users/stephenbilham/Desktop/MobX/mobx_course has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting mobx_course/ from /Users/stephen/Desktop/MobX
Done.
error Command failed.
Exit code: 1
Command: /usr/local/bin/create-react-app
Arguments: mobx_course --template typescript
Directory: /Users/stephen/Desktop/MobX
Output:
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
stephens-MacBook-Pro:MobX stephen$
Can you try yarn create-react-app ...?
Notice the - between create and react.
I believe the convention is to always have it linked with hyphens, e.g.
create-react-app
create-next-app
create-strapi-app
To give the solution for this error: you need to make sure your node -v is up to date mine was 13.5 and not compatible anymore so I updated it to 14.5

Build React-Native

I have this problem when trying to install some items
example:yarn add react-navigation;
warning " > react-native-paper#3.10.1" has unmet peer dependency "react-native-vector-
icons#*".
[5/5] 🔨 Building fresh packages...
[-/9] ⠈ waiting...
[6/9] ⠈ lib-jitsi-meet
[7/9] ⠁ node-sass
[8/9] ⠁ ejs
error /node_modules/lib-jitsi-meet: Command failed.
Exit code: 127
Command: webpack -p
Arguments:
As suggested in error you have to install react-native-vector-icons, which is the dependency of the react-native-paper. So go first install react-native-vector-icon and then try to install another package. Here is the documentation of how to install react-native-vector-icon.

npm - meaning of "Have you installed one of peer libraries?"

npm version: 5.6.0
While doing npm install [package] got the following sentence (warning?):
Have you installed one of peer libraries?
Is it a warning? What does it means?
Could not find it documented anywhere.
Example:
npm i material-ui-pickers
Have you installed one of peer libraries?
> date-fns
> luxon
> moment
+ material-ui-pickers#1.0.0-rc.9
updated 1 package in 77.671s
If you look at material-ui-pickers > package.json under you node_modules folder, you will see that the message is a post-install message. As Sebastiaan stated, it's simply material-ui-pickers advertising other modules or potential dependencies when the installation is complete.