简体   繁体   中英

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.

I'm installing pug local to the app into 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 ... . This will prompt you for your root password.

It looks like root privileges are required to install the package you're looking for. 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. In particular the wordwrap module directory.

Changed the permissions and npm installed it fine.

One of those things I would not have caught without some prodding, so thanks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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