2016-04-21 40 views
9

Tôi đang theo dõi debularah kurata's angular2 bắt đầu khóa học trên pluralsight và được cài đặt node.js và sau đó chạy npm install (sau khi cài đặt cntlm như tôi đang đứng sau tường lửa proxy của công ty) lỗi sau đâynpm lỗi cài đặt không thể đọc được kiểu chữ

> [email protected] postinstall c:\Users\test\Documents\Visual Studio 2015\Projects\Angular2 
> typings install 

typings ERR! message Unable to read typings for "es6-shim". You should check the entry paths in "es6-shim.d.ts" are up to date 
typings ERR! caused by Unable to connect to  "https://raw.githubusercontent.com/D 
efinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/es6- shim/es6-shim.d.ts" 
typings ERR! caused by connect ECONNREFUSED 103.245.222.133:443 

typings ERR! cwd c:\Users\test\Documents\Visual Studio 2015\Projects\Angular2 

typings ERR! system Windows_NT 6.1.7601 
typings ERR! command "C:\\Program Files\\nodejs\\node.exe"  "c:\\Users\\vivekba\\ 
Documents\\Visual Studio 2015\\Projects\\Angular2\\node_modules\\typings\\dist\\ 
bin.js" "install" 
typings ERR! node -v v5.10.1 
typings ERR! typings -v 0.7.12 

typings ERR! If you need help, you may report this error at: 
typings ERR! <https://github.com/typings/typings/issues> 

npm WARN optional Skipping failed optional dependency /chokidar/fsevents: 
npm WARN notsup Not compatible with your operating system or architecture: fseve 
[email protected] 
npm ERR! Windows_NT 6.1.7601 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\ 
node_modules\\npm\\bin\\npm-cli.js" "install" 
npm ERR! node v5.10.1 
npm ERR! npm v3.8.3 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] postinstall: `typings install` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script 'typings install'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the product-management package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  typings install 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs product-management 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls product-management 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  c:\Users\test\Documents\Visual Studio 2015\Projects\Angular2\npm 
+0

'do ECONNREFUSED' connect – drewmoore

Trả lời

5

Lỗi xảy ra do sự cố kết nối.

Tường lửa chắc chắn là gốc của nguyên nhân.

CẬP NHẬT

Một số người đã giải quyết được điều này thông qua thiết lập một cấu hình -

npm config set proxy "http://company.com:8000" 

Hoặc

npm config set strict-ssl false 

Hoặc

npm config set registry "http://registry.npmjs.org/" 

Bạn cũng có thể xem số issue.

THỨ HAI CẬP NHẬT

Nếu bạn đang sử dụng VS thì bạn cần phải thiết lập cấu hình từ VS nhà phát triển console

  1. Open nhà phát triển VS console
  2. Set NPM cấu hình
11

Nếu bạn ở phía sau proxy bạn có thể thử điều này (nó đã làm việc cho tôi).

Tạo một file .typingsrc và thêm dòng sau đây với thông tin proxy của bạn:

proxy="http://proxyname:port"

Source of my answer

+1

thử nó nhưng vẫn không hoạt động hoặc ném những lỗi tương tự. tôi cũng đã cố gắng sử dụng cntlm nhưng kết thúc với cùng một lỗi. – Baahubali

+2

+1 cho câu trả lời này. Typings đã không sử dụng các thiết lập Proxy NPM, bổ sung thêm file .typingsrc với các thiết lập tương tự như tập tin .npmrc của tôi đã làm cho nó phát hiện và sử dụng proxy đúng – Joon

3

tôi giải quyết theo liên kết trong câu trả lời của sơ của Pere. Tôi đã tạo một tập tin .typingsrc với những dòng này:

{ "proxy" : "http://myproxy:port/", "rejectUnauthorized" : false }

+0

này làm việc cho tôi. cảm ơn. –

4

tôi đã giải quyết tạo .typingsrc tập tin trong cùng một thư mục, với các nội dung sau đây:

proxy = http://username:[email protected]:port 
https-proxy = http://username:[email protected]:port 

Những lời "username", "password "," ip "và" cổng "phải được thay thế bằng các giá trị của proxy của bạn.

+1

điều này làm việc cho tôi. cảm ơn –

0

Tạo tệp .typingscr trong thư mục dự án của bạn song song với package.json và đặt dưới dòng. Hãy nhớ đặt nó ở định dạng ini không có định dạng json.

rejectUnauthorized = false 

Tôi đang sử dụng môi trường công ty này mà không có bất kỳ cài đặt proxy nào và nó hoạt động cho tôi, hy vọng sẽ hoạt động cho bạn.

Các vấn đề liên quan