I am trying to install express for a project, but when i run npm i express
it shows this error:
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
I am running node and npm on a raspberry pi 4 with the newest release of raspberry pi OS. Please explain what is going wrong and how to fix it
CodePudding user response:
Looks like you're trying to install on your SD card or USB drive, which I assume is formatted as FAT32. Unfortunately, FAT32 doesn't support symlinks.
You could try this:
npm install --no-bin-links express
If that doesn't work, you'll have to use a filesystem other than FAT32.
CodePudding user response:
Seems to be a permission issue.
if you're on mac, run:
sudo npm install express
if you're on windows I am not sure of the equivalent, but you have to run as administrator.