报错:
npm ERR! code ENOTEMPTY npm ERR! syscall rename npm ERR! path /home/user/.local/lib/node_modules/pkg npm ERR! dest /home/user/.local/lib/node_modules/.pkg-piikcue3 npm ERR! errno -39 npm ERR! ENOTEMPTY: directory not empty, rename '/home/user/.local/lib/node_modules/pkg' -> '/home/user/.local/lib/node_modules/.pkg-piikcue3'
关键信息:
directory not empty
因此,把/home/user/.local/lib/node_modules/pkg
删掉重来即可。
bash
rm -rf /home/user/.local/lib/node_modules/pkg/
这样搞了几次,遇到新的报错,大概如下:
/home/user/.local/bin/pkg: Permission denied
这里意思是/home/user/.local/bin/pkg
没有可执行权限,要给它可执行权限:
bash
chmod 777 /home/user/.local/bin/pkg