微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

node.js – 在Vagrant框中安装npm

我有一个使用安装了节点的PuPHPet配置的相当香草的Vagrant盒子.

但是,当我进入框中并尝试npm安装时,我似乎遇到了大量的权限问题.

即使使用sudo运行似乎也不起作用

跑进去

npm ERR! tar.unpack untar error /home/vagrant/.npm/gulp-autoprefixer/2.1.0/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/gulp-concat/2.5.2/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/gulp-livereload/3.8.0/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/path/0.11.14/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/gulp-notify/2.2.0/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/gulp-compass/2.0.3/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/gulp-minify-css/0.4.6/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/gulp-plumber/0.6.6/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/gulp-rename/1.2.0/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/gulp/3.8.11/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/gulp-uglify/1.1.0/package.tgz
npm ERR! Linux 3.13.0-32-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! path /var/www/node_modules/gulp-autoprefixer/package.json
npm ERR! code EPERM
npm ERR! errno -1

npm ERR! Error: EPERM,chown '/var/www/node_modules/gulp-autoprefixer/package.json'
npm ERR!     at Error (native)
npm ERR!  { [Error: EPERM,chown '/var/www/node_modules/gulp-autoprefixer/package.json']
npm ERR!   errno: -1,npm ERR!   code: 'EPERM',npm ERR!   path: '/var/www/node_modules/gulp-autoprefixer/package.json',npm ERR!   fstream_finish_call: 'chown',npm ERR!   fstream_type: 'File',npm ERR!   fstream_path: '/var/www/node_modules/gulp-autoprefixer/package.json',npm ERR!   fstream_class: 'FileWriter',npm ERR!   fstream_stack:
npm ERR!    [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:308:19',npm ERR!      '/usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:143:7',npm ERR!      'FSReqWrap.oncomplete (evalmachine.<anonymous>:99:15)' ] }
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!     /var/www/npm-debug.log

我已经读过写入共享文件夹并尝试向Vagrantfile添加修复程序,但没有成功

virtualBox.customize ["setexTradata",:id,"VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root","1"]

有任何想法吗?

解决方法

事实证明,这是一个https://github.com/puphpet/puphpet/issues/1378这样的PuPHPet配置的错误

修复程序可以在https://github.com/puphpet/puphpet/pull/1403中找到 – 只需要在我的Vagrantfile中替换该片段,我们就很好.我现在可以npm安装,捆绑安装等.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐