我正在嘗試為一個專案安裝 express,但是當我運行npm i express它時顯示此錯誤:
npm ERR! code EPERM
npm ERR! syscall symlink
npm ERR! path ../mime/cli.js
npm ERR! dest /media/pi/HMMM/Programming/nodejs/myFirstHTTPS/node_modules/.bin/mime
npm ERR! errno -1
npm ERR! Error: EPERM: operation not permitted, symlink '../mime/cli.js' -> '/media/pi/HMMM/Programming/nodejs/myFirstHTTPS/node_modules/.bin/mime'
npm ERR! [Error: EPERM: operation not permitted, symlink '../mime/cli.js' -> '/media/pi/HMMM/Programming/nodejs/myFirstHTTPS/node_modules/.bin/mime'] {
npm ERR! errno: -1,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'symlink',
npm ERR! path: '../mime/cli.js',
npm ERR! dest: '/media/pi/HMMM/Programming/nodejs/myFirstHTTPS/node_modules/.bin/mime'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2021-12-31T21_49_55_020Z-debug.log
我正在使用最新版本的 raspberry pi 作業系統在 raspberry pi 4 上運行 node 和 npm。請解釋發生了什么問題以及如何解決
uj5u.com熱心網友回復:
看起來您正在嘗試安裝在 SD 卡或 USB 驅動器上,我假設它們的格式為 FAT32。不幸的是,FAT32 不支持符號鏈接。
你可以試試這個:
npm install --no-bin-links express
如果這不起作用,您將不得不使用 FAT32 以外的檔案系統。
uj5u.com熱心網友回復:
似乎是一個權限問題。
如果您使用的是 mac,請運行:
sudo npm install express
如果您在 Windows 上,我不確定等效項,但您必須以管理員身份運行。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/400240.html
