运行下载的nodejs包

时间:2014-08-12 10:14:48

标签: node.js npm

我使用

安装了一个nodejs包(模块?)
sudo npm install -g ng-annotate

我该如何开始?

我已经尝试了

npm run ng-annotate test

它确实运行了一些测试,它们都通过了。很好,但用其他任何东西替换test根本不产生输出,返回码为零。例如,

npm run ng-annotate npn is a crap!

什么都不做。我还试过nodejs whatever等等。我想要的应该是什么样的

npm run ng-annotate run --add - < infile.js > outfile.js

我必须承认我没有阅读所有可用的帮助,但它是第一个忽略所有无效输入并保密的方法来运行它。我现在不想学习nodejs ;我只需要运行脚本。

1 个答案:

答案 0 :(得分:0)

根据评论,

ng-annotate run --add - < infile.js > outfile.js

应该这样做。有一个链接

/bin/ls -l /usr/bin/ng-annotate
lrwxrwxrwx 1 root root 53 2014-08-12 11:53 /usr/bin/ng-annotate -> ../lib/node_modules/ng-annotate/build/es5/ng-annotate

导致无法访问的文件

sudo /bin/ls -l /usr/lib/node_modules/ng-annotate/build/es5/ng-annotate
-rwx------ 1 nobody maaartin 49 2014-08-09 00:43 /usr/lib/node_modules/ng-annotate/build/es5/ng-annotate

我重新安装了npm并没有帮助。手动修复权限。

相关问题