首页 > 解决方案 > NPM 错误。Eacess:权限被拒绝,统计

问题描述

执行时npm start,我在收到此消息后不久遇到编译错误。

Module not found: Can't resolve '.../services/api' in '/mnt/c/Users/chung/dev/flatiron/labs/mod-5/herschmersch/frontend-herschmersch/src/containers'
/mnt/c/Users/chung/dev/flatiron/labs/mod-5/herschmersch/frontend-herschmersch/node_modules/react-scripts/scripts/start.js:19
  throw err;
  ^

[Error: EACCES: permission denied, stat '/mnt/c/Documents and Settings'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'stat',
  path: '/mnt/c/Documents and Settings'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frontend-herschmersch@0.1.0 start: `PORT=3001 react-scripts start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the frontend-herschmersch@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/nathan/.npm/_logs/2020-10-09T04_07_10_726Z-debug.log

当我在我的反应代码中删除最初导致错误的原因时,它似乎有效。我在尝试安装时也遇到了类似的问题。

任何建议都会很棒!

谢谢

编辑

我还注意到这发生在我的 node_modules 文件夹中:

// ♥  ls -la /usr/local/lib/node_modules
total 0
drwxr-xr-x 1 nathan nathan 512 Oct  8 23:37 .
drwxr-xr-x 1 root   root   512 Oct  7 12:04 ..

我试图更改所有者,但还有另一行显示 root。

标签: npm

解决方案


推荐阅读