{"id":3269,"date":"2014-03-21T18:27:54","date_gmt":"2014-03-21T18:27:54","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/21\/cannot-install-npm-on-vagrant-during-provision-collection-of-common-programming-errors\/"},"modified":"2014-03-21T18:27:54","modified_gmt":"2014-03-21T18:27:54","slug":"cannot-install-npm-on-vagrant-during-provision-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/21\/cannot-install-npm-on-vagrant-during-provision-collection-of-common-programming-errors\/","title":{"rendered":"Cannot install NPM on Vagrant during provision-Collection of common programming errors"},"content":{"rendered":"<p>During Vagrant Shell provision I try to install NodeJS and NPM on Debian Wheezy. Script is (from guide https:\/\/github.com\/joyent\/node\/wiki\/backports.debian.org):<\/p>\n<pre><code>sudo echo \"deb http:\/\/ftp.us.debian.org\/debian wheezy-backports main\" &gt;&gt; \/etc\/apt\/sources.list\nsudo apt-get update\nsudo apt-get install -y nodejs-legacy\ncurl https:\/\/npmjs.org\/install.sh | sudo sh\n<\/code><\/pre>\n<p>Node sets up as a charm, but NPM installation fails:<\/p>\n<p>Stderr from the command:<\/p>\n<pre><code>stdin: is not a tty\ndpkg-preconfigure: unable to re-open stdin: No such file or directory\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100  7810  100  7810    0     0   1407      0  0:00:05  0:00:05 --:--:-- 18956\nfetching: http:\/\/registry.npmjs.org\/npm\/-\/npm-1.3.15.tgz\nnpm-install-2877.sh: 270: npm-install-2877.sh: cannot open \/dev\/tty: No such device or address\nAborted 0.x cleanup.  Exiting.\nIt failed\n<\/code><\/pre>\n<p>I&#8217;ve googled about two days &#8211; can&#8217;t find any solution \ud83d\ude41<\/p>\n<p>If to set a Vagrant config like this:<\/p>\n<pre><code>config.ssh.shell = \"bash -c 'BASH_ENV=\/etc\/profile exec bash'\"\n<\/code><\/pre>\n<p>Then script doesn&#8217;t say anything about tty, but still fails:<\/p>\n<pre><code>Stderr from the command:\n\ndpkg-preconfigure: unable to re-open stdin: No such file or directory\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100  7810  100  7810    0     0   1412      0  0:00:05  0:00:05 --:--:-- 19772\nfetching: http:\/\/registry.npmjs.org\/npm\/-\/npm-1.3.15.tgz\nnpm-install-3013.sh: 270: npm-install-3013.sh: cannot open \/dev\/tty: No such device or address\nAborted 0.x cleanup.  Exiting.\nIt failed\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>During Vagrant Shell provision I try to install NodeJS and NPM on Debian Wheezy. Script is (from guide https:\/\/github.com\/joyent\/node\/wiki\/backports.debian.org): sudo echo &#8220;deb http:\/\/ftp.us.debian.org\/debian wheezy-backports main&#8221; &gt;&gt; \/etc\/apt\/sources.list sudo apt-get update sudo apt-get install -y nodejs-legacy curl https:\/\/npmjs.org\/install.sh | sudo sh Node sets up as a charm, but NPM installation fails: Stderr from the command: stdin: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3269","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3269","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3269"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3269\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}