2016-10-11 4 views
0

NPM 및 angular2를 처음 사용합니다. 자체 NPM 패키지를 만들고 로컬로 설치하려고합니다.npm 패키지가 예상대로 설치되지 않습니다.

├── .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 폴더를 얻을 다른 디렉토리에 설치하는 경우 : 내가 포함 된 패키지 확실히 (테스트 패키지 0.0.1.tgz를) 만들 수 관리 할 수 ​​있습니다. 내가 test-package-0.0.1.tgz

npm install C:\otherfolder\platform-core-webui-0.0.1.tgz이 패키지를 설치 만들 npm pack을 사용하고

.

다음은 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" 
} 

나는 내 설치하지 단지 node_modules 폴더 후 동일한 폴더 구조를 볼 기대했다. 내가 어디로 잘못 가고 있니?

답변

0

나는 당신 자신의 패키지/모듈을 만드는 메커니즘을 오해했을 수도 있다고 생각한다! 모듈은 핵심 단어입니다. 물론 플랫폼을 설치할 때 core-webui-0.0.1.tgz가 node_modules 폴더에 있고, 이제는 import을 사용해야합니다. 그래서 내 질문에 대답 :)

관련 문제