首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >npm安装在真空箱内

npm安装在真空箱内
EN

Stack Overflow用户
提问于 2015-02-27 01:10:50
回答 2查看 4.5K关注 0票数 5

我有一个相当普通的Vagrant,它使用带有Node的Puphpet进行配置。

但是,当我进入这个框并尝试npm install时,我似乎遇到了大量的权限问题。

即使和sudo一起跑步也不起作用。

碰上

代码语言:javascript
复制
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中,但没有成功。

代码语言:javascript
复制
      virtualbox.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]

有什么想法吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-03-05 20:46:34

原来这是一个带有Puphpet的bug,类似于So https://github.com/puphpet/puphpet/issues/1378

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

票数 1
EN

Stack Overflow用户

发布于 2015-02-27 06:11:09

你在用Windows吗?不仅需要自定义VM,还需要在权限提升时启动VM (即以管理员身份运行)。总的来说,这是一个复杂的混乱。

如果我正在使用共享文件夹中需要符号链接的东西(比如npm),我已经开始使用rsync文件夹了。使用rsync,/vagrant文件夹不再是Virtual共享文件夹,也不会出现表示符号链接的问题。作为一个额外的好处,它也是更快的方式。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28755845

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档