gpt4 book ai didi

node.js - Webpack 未在 Linux 上安装

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:38:31 26 4
gpt4 key购买 nike

最近我将我的环境从 windows 10 更改为 backbox linux 4.5.1,但我多次尝试使用 npm 安装 webpack。它从不安装它会给出这些错误。有什么帮助吗?

 verbose tar unpack /home/dove/.npm/webpack/1.12.13/package.tgz
34 silly lockFile 27155615-tar-usr-lib-node-modules-webpack tar:///usr/lib/node_modules/webpack
35 verbose lock tar:///usr/lib/node_modules/webpack /home/dove/.npm/27155615-tar-usr-lib-node-modules-webpack.lock
36 silly lockFile 5c48f9fd--npm-webpack-1-12-13-package-tgz tar:///home/dove/.npm/webpack/1.12.13/package.tgz
37 verbose lock tar:///home/dove/.npm/webpack/1.12.13/package.tgz /home/dove/.npm/5c48f9fd--npm-webpack-1-12-13-package-tgz.lock
38 silly gunzTarPerm modes [ '775', '664' ]
39 error Error: EACCES, mkdir '/usr/lib/node_modules/webpack'
39 error { [Error: EACCES, mkdir '/usr/lib/node_modules/webpack']
39 error errno: 3,
39 error code: 'EACCES',
39 error path: '/usr/lib/node_modules/webpack',
39 error fstream_type: 'Directory',
39 error fstream_path: '/usr/lib/node_modules/webpack',
39 error fstream_class: 'DirWriter',
39 error fstream_stack:
39 error [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
39 error '/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53',
39 error 'Object.oncomplete (fs.js:108:15)' ] }
40 error Please try running this command again as root/Administrator.
41 error System Linux 4.2.0-30-generic
42 error command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "webpack@1.12.13"
43 error cwd /home/dove/projects/yulu
44 error node -v v0.10.37
45 error npm -v 1.4.28
46 error path /usr/lib/node_modules/webpack
47 error fstream_path /usr/lib/node_modules/webpack
48 error fstream_type Directory
49 error fstream_class DirWriter
50 error code EACCES
51 error errno 3
52 error stack Error: EACCES, mkdir '/usr/lib/node_modules/webpack'
53 error fstream_stack /usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
53 error fstream_stack /usr/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53
53 error fstream_stack Object.oncomplete (fs.js:108:15)
54 verbose exit [ 3, true ]

最佳答案

我认为问题在于尝试在没有 sudo 权限的情况下安装 npm,因为它给出了访问错误。

“错误:EACCES,mkdir '/usr/lib/node_modules/webpack'”

你应该尝试运行前缀为“sudo”的命令

须藤“你的命令”

你也可以试试这个命令。npm 配置设置 unsafe-perm=true

github 中有关于这个错误的讨论,你可能想看看。

https://github.com/Microsoft/BashOnWindows/issues/14

关于node.js - Webpack 未在 Linux 上安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45657272/

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