gpt4 book ai didi

node.js - 通过nodejs安装Express时出错

转载 作者:太空宇宙 更新时间:2023-11-04 01:55:43 24 4
gpt4 key购买 nike

我正在尝试通过nodeJS 安装express,我收到的错误告诉我应该重命名我的目录。我已经在项目文件夹中运行了 npm init,所以我认为设置是正确的。我使用的确切命令是: npm install express --save , npm-debug.log 列出了一堆以“silly”开头的语句,但最重要的语句(imo)如下:

3242 verbose stack Error: EPERM: operation not permitted, rename 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\.staging\depd-c51a5acf' -> 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\depd'
3242 verbose stack at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:25:7)
3242 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
3242 verbose stack at FSReqWrap.oncomplete (fs.js:123:15)
3242 verbose stack
3242 verbose stack Error: EPERM: operation not permitted, rename 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\.staging\depd-c51a5acf' -> 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\depd'
3242 verbose stack at Error (native)
3243 verbose cwd C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron
3244 error Windows_NT 10.0.16299
3245 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "express" "--save"
3246 error node v6.11.2
3247 error npm v3.10.10
3248 error path C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\.staging\depd-c51a5acf
3249 error code EPERM
3250 error errno -4048
3251 error syscall rename
3252 error Error: EPERM: operation not permitted, rename 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\.staging\depd-c51a5acf' -> 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\depd'
3252 error at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:25:7)
3252 error at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
3252 error at FSReqWrap.oncomplete (fs.js:123:15)
3252 error
3252 error Error: EPERM: operation not permitted, rename 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\.staging\depd-c51a5acf' -> 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\depd'
3252 error at Error (native)
3252 error { Error: EPERM: operation not permitted, rename 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\.staging\depd-c51a5acf' -> 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\depd'
3252 error at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:25:7)
3252 error at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
3252 error at FSReqWrap.oncomplete (fs.js:123:15)
3252 error
3252 error Error: EPERM: operation not permitted, rename 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\.staging\depd-c51a5acf' -> 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\depd'
3252 error at Error (native) parent: 'microtrack' }
3253 error Please try running this command again as root/Administrator.
3254 verbose exit [ -4048, true ]`

背景:我一直在 YT 上关注 Brad Traversy 的 NodeJS 和 Express 数据库应用程序系列,试图学习一些在我的副项目中使用的后端内容,并且他使用的命令(上面列出的)运行得非常完美。

预先感谢您的任何帮助/建议。

最佳答案

我做了一些更多的研究,发现在关闭 Atom IDE 后运行 npm install 命令是有效的。感谢大家的帮助!

完整线程:https://github.com/npm/npm/issues/12059在页面底部回答

关于node.js - 通过nodejs安装Express时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48055789/

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