简体   繁体   English

NPM不会安装哈巴狗吗?

[英]NPM won't install pug?

Can anyone help me decipher what this message is about? 谁能帮助我解读此消息的含义? I have another app with pug installed, yet now I cannot create a new module installation for some reason. 我有另一个安装了pug的应用程序,但是由于某种原因现在我无法创建新的模块安装。

I'm installing pug local to the app into node_modules 我正在将应用程序本地的pug安装到node_modules中

I'm just trying to get work done, so if I have missed something simple, my stress level has not been helpful with keeping precise vision. 我只是想把工作做好,所以如果我错过了一些简单的事情,压力水平对保持精确的视力没有帮助。

My system is for ongoing development so I don't muck around with upgrades, which historically has broken all kinds of other stuff. 我的系统用于持续开发,因此我不会在升级过程中乱糟糟,因为升级历史上已经破坏了所有其他东西。

My other app works fine. 我的其他应用程序运行正常。

# npm install --save pug@2.0.0-beta4 <= Because the working app uses this one
npm ERR! Linux 3.2.0-35-generic-pae
npm ERR! argv "/home/kingram/.nvm/v0.10.46/bin/node" "/home/kingram/.nvm/v0.10.46/bin/npm" "install" "--save" "pug@2.0.0-beta4"
npm ERR! node v0.10.46
npm ERR! npm  v2.15.1
npm ERR! path /home/kingram/.npm/wordwrap/0.0.2
npm ERR! code EACCES
npm ERR! errno 3

npm ERR! Error: EACCES, mkdir '/home/kingram/.npm/wordwrap/0.0.2'
npm ERR!  { [Error: EACCES, mkdir '/home/kingram/.npm/wordwrap/0.0.2']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/home/kingram/.npm/wordwrap/0.0.2',
npm ERR!   parent: 'cliui' }
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!     /home/kingram/node/fssreg/npm-debug.log

You may need to install using sudo, ie - sudo npm install ... . 您可能需要使用sudo进行安装,即sudo npm install ... This will prompt you for your root password. 这将提示您输入root密码。

It looks like root privileges are required to install the package you're looking for. 似乎需要root特权才能安装所需的软件包。 Though this shouldn't really be the case, you can fix this.... check out this link 尽管实际上并非如此,但您可以解决此问题。... 请查看此链接

After some prodding by @zillaofthegods, it turns out some of directories in ~/.npm were owned by root. 经过@zillafthegods的查询后,发现〜/ .npm中的某些目录是root拥有的。 In particular the wordwrap module directory. 特别是自动换行模块目录。

Changed the permissions and npm installed it fine. 更改了权限,npm很好地安装了它。

One of those things I would not have caught without some prodding, so thanks. 如果没有一些建议,我将无法抓住其中一件事情,所以谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM