我正在尝试使用命令安装typescript npm install -g typescript,并返回此错误:
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Linux 4.4.0-93-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "typescript"
npm ERR! node v6.11.2
npm ERR! …Run Code Online (Sandbox Code Playgroud) 当我输入“npm run build:prod”时
\nbuild:prod\n npm run build -- --configuration production --aot --optimization=false\nRun Code Online (Sandbox Code Playgroud)\n我收到此错误:
\n> fancy-name@0.0.0 build:prod\n> npm run build -- --configuration production --aot --optimization=false\n\nglob error [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] {\n errno: -13,\n code: 'EACCES',\n syscall: 'scandir',\n path: '/root/.npm/_logs'\n}\nnpm WARN logfile Error: EACCES: permission denied, scandir '/root/.npm/_logs'\nnpm WARN logfile error cleaning log files [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] {\nnpm WARN logfile errno: -13,\nnpm WARN logfile code: 'EACCES',\nnpm WARN logfile syscall: 'scandir',\nnpm WARN logfile path: '/root/.npm/_logs'\nnpm …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用此命令安装monaca。
npm install -g monaca
Run Code Online (Sandbox Code Playgroud)
但是在收到这些错误之后:
npm WARN checkPermissions缺少对/ usr / local / lib / node_modules的写权限npm ERR!路径/ usr / local / lib / node_modules npm错误!代码EACCES npm ERR!errno -13 npm错误!syscall访问npm ERR!错误:EACCES:权限被拒绝,访问'/ usr / local / lib / node_modules'npm ERR!{错误:EACCES:权限被拒绝,访问'/ usr / local / lib / node_modules'npm ERR!堆栈:'错误:EACCES:权限被拒绝,访问\'/ usr / local / lib / node_modules \'',npm ERR!errno:-13,npm错误!代码:“ EACCES”,npm错误!syscall:“访问”,npm错误!路径:'/ usr / local / lib / node_modules'}
任何想法如何解决这个问题?谢谢
我在尝试在 React 应用程序中构建 docker 容器时遇到权限错误。
\n我尝试利用社区答案,但没有帮助。
\n以下相关讨论我尝试过:
id -unsudo chown -R myUser:myUser /usr/local/lib/node_modulessudo chown -R ownerName: /usr/local/lib/node_modulessudo chown -R $USER /usr/local/lib/node_modulessudo chown -R $USER /app/node_modulessudo npm install -g --unsafe-perm=true --allow-rootsudo:sudo npm install将其添加到docker-compose文件中也没有帮助:
environment:\n - CHOKIDAR_USEPOLLING=true\nRun Code Online (Sandbox Code Playgroud)\n我正在尝试使用以下命令进行构建:docker-compose up --build
Dockerfile.dev 文件
\nFROM node:alpine\n\nWORKDIR \'/app\'\n\nCOPY …Run Code Online (Sandbox Code Playgroud) 这太令人沮丧了..我正在尝试为node.js 安装sequalize。我在本地成功安装了它,但无法全局安装它(我收到权限被拒绝的错误:
\'../lib/node_modules/sequelize-cli/lib/sequelize\').
Run Code Online (Sandbox Code Playgroud)
我实际上并不希望它全局安装,但是当在本地安装它并且应该配置和初始化sequelize模块(通过在终端中输入sequelize init:models&sequelize init:config)时,我收到以下错误:
-bash: sequelize: command not found
Run Code Online (Sandbox Code Playgroud)
因此,我做了功课,发现命令未找到错误可以通过全局安装(-bash:sequelize:命令未找到)来解决,并修复启用全局安装时的错误,我更改了用户访问权限(错误:EACCES:权限被拒绝,访问'/usr/local/lib/node_modules'react),但这并没有达到目的,我仍然被拒绝权限。
所以我的问题是如何在终端中运行sequelize init:models 和sequelize init:config 而不会出现找不到命令的情况?
npx install-peerdeps --dev eslint-config-airbnb
install-peerdeps v3.0.3
Installing peerdeps for eslint-config-airbnb@latest.
npm install eslint-config-airbnb@18.2.1 eslint@^7.2.0 eslint-plugin-import@^2.22.1 eslint-plugin-jsx-a11y@^6.4.1 eslint-plugin-react@^7.21.5 eslint-plugin-react-hooks@^1.7.0 --save-dev
ERR undefined
Run Code Online (Sandbox Code Playgroud)
我知道那是什么。已经尝试重新安装节点(LTS 和当前)。路径变量有效。
如您所见,我定期安装版本 9。
\n\nnpm install -g @angular/cli\nnpm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142\n/home/user/.npm-global/bin/ng -> /home/user/.npm-global/lib/node_modules/@angular/cli/bin/ng\n\n> @angular/cli@9.1.1 postinstall /home/user/.npm-global/lib/node_modules/@angular/cli\n> node ./bin/postinstall/script.js\n\n+ @angular/cli@9.1.1\nupdated 1 package in 8.412s\n\n\xe2\x94\x8c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x90\n\xe2\x94\x82 npm update check failed \xe2\x94\x82\n\xe2\x94\x82 Try running with sudo or get access \xe2\x94\x82\n\xe2\x94\x82 to the local update config store via \xe2\x94\x82\n\xe2\x94\x82 sudo chown -R $USER:$(id -gn $USER) /home/user/.config \xe2\x94\x82\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x98\nuser@computer:~$ npm list -g\n/home/user/.npm-global/lib\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\xac @angular/cli@9.1.1\nRun Code Online (Sandbox Code Playgroud)\n\n但是当我使用“ng new app-name”创建新应用程序时,我会安装版本 8。当我使用“ng --version”检查版本时,它表示已安装 v8。
\n\nng --version \n\nAngular CLI: 8.0.3\nNode: 12.16.2\nOS: linux x64\nAngular: \n... \n\nPackage Version\n------------------------------------------------------\n@angular-devkit/architect …Run Code Online (Sandbox Code Playgroud) Mac mini(M1,2020)
蒙特雷
布朗尼 v1.17.2
Nodejs v16.13.4
我正在根据参考资料学习可靠性(https://www.youtube.com/watch?v=M576WGiDBdQ&t=25510s)。
Node.JS 安装没问题
当我尝试这个时
npm install --global yarn
Run Code Online (Sandbox Code Playgroud)
终端给出错误信息
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/yarn
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/yarn'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/yarn'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/yarn'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your …Run Code Online (Sandbox Code Playgroud) 我在尝试为 MacBook 安装 NestJS 时遇到问题,当我使用 $ npm install -g @nestjs/cli 时,此错误不断在我的终端中弹出。我是否做错了什么或者我没有将此命令行放在正确的位置?请帮忙 :)
npm ×7
node.js ×4
macos ×3
javascript ×2
node-modules ×2
reactjs ×2
terminal ×2
angular ×1
angular-cli ×1
angularjs ×1
cmd ×1
command-line ×1
docker ×1
installation ×1
linux ×1
monaca ×1
nestjs ×1
sequelize.js ×1
shell ×1