0

I am trying to install css less but getting this error:

npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Program Files\nodejs\node_modules\.staging
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'
npm ERR!  [OperationalError: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'mkdir',
npm ERR!     path: 'C:\\Program Files\\nodejs\\node_modules\\.staging'
npm ERR!   }

Tried to do is also in Git Bash as administrator but gets this:

$ npm install less -g
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path C:\Users\me_adm\AppData\Roaming\npm
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\igorska_adm\AppData\Roaming\npm'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

Did anyone face this kind of issue?

Tried also:

  • npm cache clean
  • deleting package-lock
Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
  • Does this answer your question? [EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node\_modules\.staging](https://stackoverflow.com/questions/58078937/eperm-operation-not-permitted-mkdir-c-program-files-nodejs-node-modules-sta) – Daniel A. White May 06 '21 at 20:49

1 Answers1

-1

An easier way to do this would be to compile it with PHP or link the JS library through the HTML page. This way you can avoid NPM and it will be faster.

<link rel="stylesheet/less" type="text/css" href="styles.less" />
<script src="//cdn.jsdelivr.net/npm/less@3.13" ></script>

Link your styles in the style tag and leave the script tag to have the compiler imported.

awholegnuworld
  • 381
  • 1
  • 12