我是NPM和angular2的新手,我正在尝试创建自己的NPM包并在本地安装它。我设法创建包好的(test-package-0.0.1.tgz),其中包含:
strings -f -n30 i15app.fmb | grep -i getApplQuota
然而,当我尝试将其安装在不同的目录中时,我只获得一个├── .npmignore
├── README.md
├── LICENSE
├── index.html
├── package.json
├── main.js
├── styles.css
├── tsconfig.json
├── typings.json
├── app
│ └── app.component.ts
│ └── app.module.ts
│ └── main.js
│ └── main.ts
文件夹。
我正在使用node_modules
创建npm pack
和test-package-0.0.1.tgz
安装软件包。
以下是我的npm install C:\otherfolder\platform-core-webui-0.0.1.tgz
文件的内容,我在Windows环境中运行。
package.json
我希望在安装后看到完全相同的文件夹结构而不仅仅是{
"name": "test-package",
"version": "0.0.1",
"description": "Test package",
"author": "me",
"publishConfig": {
"registry": "http://localnpmrepository/npm"
},
"scripts": {
"start": "tsc && concurrently \"tsc -w\" \"lite-server\" ",
"lite": "lite-server",
"postinstall": "typings install",
"tsc": "tsc",
"tsc:w": "tsc -w",
"typings": "typings"
},
"license": "UNLICENSED",
"dependencies": {
"@angular/common": "~2.0.2",
"@angular/compiler": "~2.0.2",
"@angular/core": "~2.0.2",
"@angular/forms": "~2.0.2",
"@angular/http": "~2.0.2",
"@angular/platform-browser": "~2.0.2",
"@angular/platform-browser-dynamic": "~2.0.2",
"@angular/router": "~3.0.2",
"@angular/upgrade": "~2.0.2",
"angular-in-memory-web-api": "~0.1.5",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"reflect-metadata": "^0.1.8",
"rxjs": "5.0.0-beta.12",
"systemjs": "0.19.39",
"zone.js": "^0.6.25"
},
"devDependencies": {
"concurrently": "^3.0.0",
"lite-server": "^2.2.2",
"typescript": "^2.0.3",
"typings": "^1.4.0"
},
"main": "main.js"
}
文件夹。我哪里错了?
答案 0 :(得分:0)
我相信我可能误解了创建自己的软件包/模块的机制!模块是关键词,当然,当我安装我的platform-core-webui-0.0.1.tgz时,它将自己安装在node_modules
文件夹中,我现在需要import
将它放入一个组件中使用。所以这回答了我的问题:)