上周我在 NPM 上发布了一个非常简单的包。它只包含三个文件:
package.json README.md tofjs-full.node.js
包含整个tofjs-full.node.js
代码,包被调用tofjs-full
,它应该在require('tofjs-full')
调用后可用。
该package.json
文件具有以下内容:
{ "name": "tofjs-full",
"version": "1.0.0",
"description": "`tofjs-full` is the current state of the [TofJs](http://tofjs.org) program, bundled in a single NPM package.",
"author": "bucephalus <bucephalus.org@gmail.com> (http://bucephalus.org)",
"license": "ISC",
"homepage": "http://tofjs.org/program/tofjs-full",
"bugs": { "url": "https://groups.google.com/forum/#!forum/tofjs" },
"repository": "http://tofjs.org/package/tofjs-full/1.0.0/",
"main": "tofjs-full.node.js",
"dependencies": {
"fs-extra": "^0.30.0",
"markdown": "^0.5.0",
"sha1": "^1.1.1",
"sha1-file": "^1.0.0",
"coffee-script": "^1.10.0",
"escodegen": "^1.8.0",
"esprima": "^2.7.2"
},
"files": [ "tofjs-full.node.js" ] }
我通过转到相应的目录并调用来发布包
npm publish
我不记得确切的反应。但是该包tofjs-full
现在可以从 NPM 存储库 ( https://www.npmjs.com/package/tofjs-full ) 正式获得。
但是,当我转到另一台机器并尝试 sudo npm install tofjs-full 时,答案是显示所有依赖项的树,然后是一些警告(每行以 开头npm WARN
):
ENOENT: no such file or directory, open `'/path/to/dir/package.json'
No description field.
No README data.
No license field.
你能告诉我出了什么问题吗?谢谢你,布塞法洛斯