Encountered an error message while using stylus with npm on my Linux machine. After installing nodejs from GitHub, I executed the command
npm install -g stylus autoprefixer-stylus
and received the following error log:
npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/autoprefixer-stylus'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, unlink '/usr/local/lib/node_modules/autoprefixer-stylus']
npm ERR! stack: 'Error: EACCES, unlink \'/usr/local/lib/node_modules/autoprefixer-stylus\'\n at Error (native)',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/autoprefixer-stylus' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
... (Additional error details)
Realized that running the command with sudo
resolves the issue. However, the next output after adding sudo
is:
/usr/local/bin/stylus -> /usr/local/lib/node_modules/stylus/bin/stylus
... (Dependency details)
... (More information about the output)
Attempted to run
stylus -u autoprefixer-stylus -w style.styl
but encountered another error:
/usr/local/lib/node_modules/stylus/bin/stylus:625
if (err) throw err;
^
Error: ENOENT, stat '-stylus'
at Error (native)
Unsure of the cause of this error or if anything is missing in the process. Any insights would be appreciated.