gpt4 book ai didi

javascript - Node Express 安装错误

转载 作者:行者123 更新时间:2023-11-29 21:41:34 25 4
gpt4 key购买 nike

您好,我正在尝试安装 Node Express Framework。但它正在抛出以下错误

rajdeep@rajdeep-Lenovo-G50-80:/var/www/mynode$ npm install -g express-generator
npm WARN locking Error: EACCES, open '/home/rajdeep/.npm/_locks/express-generator-981ece2c3651799f.lock'
npm WARN locking at Error (native)
npm WARN locking /home/rajdeep/.npm/_locks/express-generator-981ece2c3651799f.lock failed { [Error: EACCES, open '/home/rajdeep/.npm/_locks/express-generator-981ece2c3651799f.lock']
npm WARN locking errno: -13,
npm WARN locking code: 'EACCES',
npm WARN locking path: '/home/rajdeep/.npm/_locks/express-generator-981ece2c3651799f.lock' }
npm ERR! Linux 3.16.0-30-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "express-generator"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3

npm ERR! Attempt to unlock /usr/lib/node_modules/express-generator, which hasn't been locked
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR! /var/www/mynode/npm-debug.log

最佳答案

在安装全局模块时,您(取决于您安装 node/npm 的方式)需要以 root 身份执行安装命令,因此:

sudo npm install -g express-generator

关于javascript - Node Express 安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32667654/

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