ENOSYS:功能未实现
Posted
技术标签:
【中文标题】ENOSYS:功能未实现【英文标题】:ENOSYS: function not implemented 【发布时间】:2021-04-28 05:56:42 【问题描述】:我最近在 raspbian 操作系统的 raspi 4 中安装了 next js use to npm。每次我安装react js,next js,gatsby都会给我同样的错误。
这时候我安装nextjs 使用yarn。另外,我使用 npm 和 npx 来显示相同的错误。所以我开始寻找解决方案然后有人告诉我使用 sudo 所以我使用 sudo 但不起作用
sudo yarn create next-app
检查我的代码错误输出
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 $
【问题讨论】:
【参考方案1】:你可以试试这个:
-
删除 yarn.lock。
删除 node_modules。
使用 --ignore-optional 标志 (yarn --ignore-optional);这些不安装可选依赖项。
fsevents 包仅适用于 macOS;在 Linux 中你不需要它。
如果其中任何一个有效,您可以删除 ignore 并查看 .yarnclean 是否有效。
【讨论】:
【参考方案2】:根据日志,脚本似乎无法创建符号链接
"ENOSYS: function not implemented, symlink '../../../../terser/bin/terser' -> '/media/pi/8243-BE00/next/myapp/node_modules/@ampproject/toolbox-optimizer/node_modules/.bin/terser'".
您使用的文件系统是什么?我知道 exFAT 和 FAT32 不支持符号链接。
参考:https://docs.microsoft.com/en-us/windows/win32/fileio/filesystem-functionality-comparison
【讨论】:
以上是关于ENOSYS:功能未实现的主要内容,如果未能解决你的问题,请参考以下文章