linux npm 安装出现 -38 symlink 错误解决

linux npm 安装出现 -38 symlink 错误解决

linux 安装部署 hexo 时,出现安装错误,日志如下

npm WARN enoent ENOENT: no such file or directory, open '/media/pi/storage/test/hexo/package.json'
npm WARN hexo No description
npm WARN hexo No repository field.
npm WARN hexo No README data
npm WARN hexo No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.1 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/nunjucks/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})

npm ERR! path ../acorn/bin/acorn
npm ERR! code ENOSYS
npm ERR! errno -38
npm ERR! syscall symlink
npm ERR! ENOSYS: function not implemented, symlink '../acorn/bin/acorn' -> '/media/pi/storage/test/hexo/node_modules/.bin/acorn'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2019-10-16T08_55_56_775Z-debug.log

这个问题是文件系统导致的,也就是说我使用的是linux系统,但是插入的是 NTFS 格式的移动硬盘
当在 NTFS 格式硬盘上安装包的时候,会导致失败,linux 不支持该文件系统下创建文件链接

解决方式将移动硬盘在 linux 下格式化即可

或者 cd ~mkdir hexo && cd hexo ,将软件包安装在自己的用户目录下,就没有 symlink error 问题了

Copyright: 采用 知识共享署名4.0 国际许可协议进行许可

Links: https://zwc365.com/2019/10/16/linux-npm-安装出现-38-symlink-错误解决

Buy me a cup of coffee ☕.