简体   繁体   中英

WSL v1 - npm crashes at installing grpc

I'm using WSL v.1 and I'm trying to start locally the DataTurks ' frontend bazaar app which is React based. So I basically type npm install but I run into an error when the npm reaches the library grpc and the error provided is:

path /home/kmartin62/DataTurks/bazaar/node_modules/.staging/grpc-2c7a1feb/node_modules/mkdirp
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall rename
npm ERR! Error: EACCES: permission denied, rename '/home/kmartin62/DataTurks/bazaar/node_modules/.staging/grpc-2c7a1feb/node_modules/mkdirp' -> '/home/kmartin62/DataTurks/bazaar/node_modules/.staging/mkdirp-97188a16'
npm ERR!  { Error: EACCES: permission denied, rename '/home/kmartin62/DataTurks/bazaar/node_modules/.staging/grpc-2c7a1feb/node_modules/mkdirp' -> '/home/kmartin62/DataTurks/bazaar/node_modules/.staging/mkdirp-97188a16'
npm ERR!   cause:
npm ERR!    { Error: EACCES: permission denied, rename '/home/kmartin62/DataTurks/bazaar/node_modules/.staging/grpc-2c7a1feb/node_modules/mkdirp' -> '/home/kmartin62/DataTurks/bazaar/node_modules/.staging/mkdirp-97188a16'
npm ERR!      errno: -13,
npm ERR!      code: 'EACCES',
npm ERR!      syscall: 'rename',
npm ERR!      path: '/home/kmartin62/DataTurks/bazaar/node_modules/.staging/grpc-2c7a1feb/node_modules/mkdirp',
npm ERR!      dest: '/home/kmartin62/DataTurks/bazaar/node_modules/.staging/mkdirp-97188a16' },
npm ERR!   stack: 'Error: EACCES: permission denied, rename \'/home/kmartin62/DataTurks/bazaar/node_modules/.staging/grpc-2c7a1feb/node_modules/mkdirp\' -> \'/home/kmartin62/DataTurks/bazaar/node_modules/.staging/mkdirp-97188a16\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'rename',
npm ERR!   path: '/home/kmartin62/DataTurks/bazaar/node_modules/.staging/grpc-2c7a1feb/node_modules/mkdirp',
npm ERR!   dest: '/home/kmartin62/DataTurks/bazaar/node_modules/.staging/mkdirp-97188a16',
npm ERR!   parent: '@firebase/firestore' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

I tried to install it as a super-user, sudo but the error keeps flashing. I even installed grpc with -g option ahead, for a global install, but when I run npm install after this it crashes again.

Has anyone experienced this or does anyone know how to solve it?

This is an instance of one of the oldest bugs in WSL v1, impacting many different npm packages: https://github.com/microsoft/WSL/issues/14 . I also use WSL for development and I resolved the problem by switching to WSL v2.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM