[英]install optimise with npm from optimist.js file
如果您只想使用该软件包,
$ npm install -g carto
应该足以让您入门。 请注意,您可能需要对该命令使用sudo
。
Node.js以名为“ npm”的软件包管理器为中心。 每个npm项目在其根目录下都有一个package.json,用于指定其依赖项,包名称,版本等。 通过查看carto的package.json,即使您成功安装了optimist,也将遇到更多require
错误。
如果要开发软件包,请在使用Git克隆后运行
$ npm install
在目录中。 这将为您安装所有依赖项(包括在安装软件包本身时未安装的devDependencies
)。
关于Node.js的工作方式,有很多教程,例如http://nodeguide.com/beginner.html 。 那些应该给你比这个答案更全面的看法。
使用适当的软件包管理器(如npm),您永远不应使用Internet上发现的随机脚本将其伪造为模块。
祝好运!
现在知道了npm的工作原理,请进行更新 ,如果要使其在本地可用,可以执行以下操作
# With Internet
# Make a cache
$ mkdir carto-cache
# Make a temporary directory where the initial copy of carto is installed
$ mkdir to-be-discarded
$ cd to-be-discarded
# Now install the package, and cache the package in carto-cache
$ npm install --cache ../carto-cache --prefix . carto
# You can now remove to-be-discarded, and copy carto-cache to wherever you want.
# Without internet
$ npm install --cache carto-cache --cache-min 999999999 -g carto
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.