上週我發佈了一個非常簡單的NPM軟件包。它僅包括三個文件:`npm publish`然後`npm install`不能恢復已發佈的軟件包
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 <[email protected]> (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)正式獲得。
然而,當我去到另一臺機器,並嘗試 須藤NPM安裝tofjs全 答案是所有的依賴關係,然後一些警告的樹顯示(每行開頭npm WARN
):
ENOENT: no such file or directory, open `'/path/to/dir/package.json'
No description field.
No README data.
No license field.
你能告訴我發生了什麼事嗎? 謝謝比塞弗勒斯
...對不起,我的意思是說:「包'tofjs-full'現在可以從NPM存儲庫正式獲得。」而不是「......不正式可用......」。 – user2527816