Tag: bash

如何设置pipe理员运行一个shell脚本

设置一个Dockerfile来安装节点prereqs,然后设置supervisor以运行最后的npm install命令。 在VirtualBox下的CoreOS中运行Docker。 我有一个Dockerfile ,可以正确设置所有的东西: FROM ubuntu MAINTAINER <<Me>> # Install docker basics RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list RUN apt-get update RUN apt-get upgrade -y # Install dependencies and nodejs RUN apt-get update RUN apt-get install -y python-software-properties python g++ make RUN add-apt-repository ppa:chris-lea/node.js RUN apt-get update RUN apt-get install -y […]

npm后安装失败与多个命令

在我的composer.json里面,有一个像下面这样的postinstall挂接安装程序: "scripts" : { "dist" : "node dist; node_modules/.bin/doccoh src/package.js", "postinstall" : "node_modules/.bin/grunt setup || true; node_modules/.bin/bower install", "start" : "node server.js" } 每当我运行它(从Git / Gnu Bash CLI获胜),我结束 command not found. either the command was written wrong or couldn't be found 德语CLI错误的粗略翻译。 我试图分裂成多个; /分号分隔的部分,并首先进入该目录的cd ,但它只是结束了相同的错误信息。 用一个简单的ls代替整个postinstall命令集可以工作。 所以我想这个问题可能是分号分隔或命令的错误使用。 但总的来说,我不知道什么是错的。 注意:我在全球安装了grunt-cli 0.1.9版和grunt 0.4.1版。

只有在尚未安装npm包的情况下是否可以安装?

只有在尚未安装npm包的情况下是否可以安装? 我需要这个来加快对CircleCI的testing,但是当我运行npm install protractor@2.1.0等时,它总是从scracth下载东西并安装它们,但是,所有模块的node_modules文件夹在运行命令时已经存在从以前的版本caching)和protractor –version等显示所需的版本的包。 它是完美的有这样一些单行命令: protractor –version || npm install -g protractor@2.1.0 但也会检查包的版本。

brew安装npm“npm:command not found”

我已经使用brew install node ,当我使用node -v我得到了v5.0.0 。 但是,当我尝试运行npm命令,我得到npm: command not found 。 我试着运行brew install npm ,但是我刚刚brew install npm了以下响应node-5.0.0 already installed 。 它发生了节点也返回命令没有find,但我通过运行brew link node ,但是npm仍然似乎不工作。 我该如何解决这个问题?

无法使用curl安装NPM

尝试安装NPM时收到此错误。 任何帮助这个错误是不胜感激。 $ curl http://npmjs.org/install.sh | sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 85 0 85 0 0 2226 0 –:–:– –:–:– –:–:– 4473 sh: line 1: syntax error near unexpected token `newline' sh: line 1: `<html>Moved: <a href="https://npmjs.org/install.sh">https://npmjs.org/install.sh</a>' 从http:// … – […]

如何检测Node.js脚本是否通过shellpipe道运行?

我的问题类似于这个: 如何检测我的shell脚本是否通过pipe道运行? 。 不同之处在于我正在使用的shell脚本是用Node.js编写的。 假设我input: echo "foo bar" | ./test.js 那么怎样才能在test.js获得"foo bar"的test.js呢? 我读过Unix和Node:Pipes和Streams,但似乎只是提供了一个asynchronous解决scheme(除非我错了)。 我正在寻找一个同步解决scheme。 而且,用这种技术,检测脚本是否被pipe道化似乎并不是很直接。 TL; DR我的问题是双重的: 如何检测Node.js脚本是否通过shellpipe道运行,例如echo "foo bar" | ./test.js echo "foo bar" | ./test.js ? 如果是这样,如何读出Node.js中的pipe道值?

使用npm安装后在bash中找不到命令

只是安装了新的ubuntu虚拟机,按照以下顺序testing节点安装的东西: node mongodb-server npm express mongoose 现在,试图创build一个新的应用程序,我注意到快递不能在shell中使用。 express -v返回express:找不到命令 我像这样安装了npm curl http://npmjs.org/install.sh | sudo sh 我用这种方式安装快递 npm install express 有任何想法吗?

无法运行节点app.js文件

我正在学习node.js,我正尝试使用命令node app.js运行app.js文件,但是bash不返回任何内容(也没有错误)。 以下是我遵循的步骤: $ brew install node $ sudo npm install -g express $ sudo npm install -g express-generator 进入我创build的新文件夹后,我运行 $ express testsite –hogan -c less $ cd testsite && npm install 最后 $ node app.js返回没有错误,但没有回来,除了新的命令行… 任何帮助,这将是伟大的。 谢谢!