npm - ENOSYS:功能未实现
问题描述
我最近在 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 $
解决方案
根据日志,看起来脚本无法创建符号链接
"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
推荐阅读
- javascript - React 在按钮单击时渲染新图像(每次检索图像的新 fetch 调用)
- amazon-web-services - 使用 AWS 负载均衡器之一对 gRPC 请求进行负载均衡
- swift - 如何禁用允许删除提示?
- reactjs - 静态和动态Key和Value的setState的区别?
- mysql - 第 1 行附近的 INTERVAL:由 org.hibernate.hql.internal.ast.QuerySyntaxException 引起
- vue.js - 如何从 iframe vuejs 获取 src
- json - 在反应中从json数据动态生成列表
- big-o - c 必须有多低才能从 O(cn) 中删除常数?
- python - Python 或 Pandas 左外连接或与一个键合并为列表
- jaxb - JiBX 中是否有 JaxB 的 ObjectFactory 的对应物?