gpt4 book ai didi

docker - docker容器内的npm安装错误

转载 作者:行者123 更新时间:2023-12-02 20:31:52 25 4
gpt4 key购买 nike

我是Docker的新手。使用docker run登录到容器并运行以下命令后,出现错误。

ubuntu@eef407281d9d:/usr/src/svx-frontend$ npm install


enoent ENOENT: no such file or directory, open '/usr/src/svx-frontend/package.json'
npm WARN svx-frontend No description
npm WARN svx-frontend No repository field.
npm WARN svx-frontend No README data
npm WARN svx-frontend No license field.
npm ERR! Linux 4.4.0-42-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! path /usr/src/svx-frontend/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir

npm ERR! Error: EACCES: permission denied, mkdir '/usr/src/svx-frontend/node_modules'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, mkdir '/usr/src/svx-frontend/node_modules'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/src/svx-frontend/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Linux 4.4.0-42-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! path npm-debug.log.1447058929
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open

npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.1447058929'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, open 'npm-debug.log.1447058929'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: 'npm-debug.log.1447058929' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! /usr/src/svx-frontend/npm-debug.log

最佳答案

要下载并安装node.js,请使用命令:

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs

要下载npm,请使用commend:
curl -L https://www.npmjs.com/install.sh | sh

并运行它。

希望对您有所帮助

关于docker - docker容器内的npm安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43493093/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com