簡體   English   中英

使用npm錯誤安裝軟件包

[英]Install package using npm error

我在這里查看npm文檔https://docs.npmjs.com/all以正確學習如何使用它,我設法下載了正確的節點和npm,版本已正確檢查,然后將npm的默認目錄更改為另一個目錄,現在是像這樣:

MacBook-Pro-2:~ macetti$ npm config get prefix
/Users/macetti/npm-global

問題是然后當我嘗試使用此命令進行安裝時

npm install lodash

出現這個

npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "lodash"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1

npm ERR! error:0906D06C:PEM routines:PEM_read_bio:no start line
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/macetti/npm-debug.log

這是我的npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'install', 'lodash' ]
2 info using npm@2.10.1
3 info using node@v0.12.4
4 verbose config Skipping project config: /Users/macetti/.npmrc. (matches userconfig)
5 verbose install initial load of /Users/macetti/package.json
6 verbose readDependencies loading dependencies from /Users/macetti/package.json
7 silly cache add args [ 'lodash', null ]
8 verbose cache add spec lodash
9 silly cache add parsed spec { raw: 'lodash',
9 silly cache add   scope: null,
9 silly cache add   name: 'lodash',
9 silly cache add   rawSpec: '',
9 silly cache add   spec: '*',
9 silly cache add   type: 'range' }
10 silly addNamed lodash@*
11 verbose addNamed "*" is a valid semver range for lodash
12 silly addNameRange { name: 'lodash', range: '*', hasData: false }
13 silly mapToRegistry name lodash
14 silly mapToRegistry using default registry
15 silly mapToRegistry registry https://registry.npmjs.org/
16 silly mapToRegistry uri https://registry.npmjs.org/lodash
17 verbose addNameRange registry:https://registry.npmjs.org/lodash not in flight; fetching
18 verbose request uri https://registry.npmjs.org/lodash
19 verbose request no auth needed
20 info attempt registry request try #1 at 09:54:46
21 verbose request id f688faead59da217
22 http request GET https://registry.npmjs.org/lodash
23 verbose stack Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
23 verbose stack     at Error (native)
23 verbose stack     at Object.createSecureContext (_tls_common.js:108:19)
23 verbose stack     at Object.exports.connect (_tls_wrap.js:852:21)
23 verbose stack     at Agent.createConnection (https.js:82:14)
23 verbose stack     at Agent.createSocket (_http_agent.js:194:16)
23 verbose stack     at Agent.addRequest (_http_agent.js:166:23)
23 verbose stack     at new ClientRequest (_http_client.js:154:16)
23 verbose stack     at Object.exports.request (http.js:49:10)
23 verbose stack     at Object.exports.request (https.js:136:15)
23 verbose stack     at Request.start (/usr/local/lib/node_modules/npm/node_modules/request/request.js:963:30)
24 verbose cwd /Users/macetti
25 error Darwin 14.4.0
26 error argv "node" "/usr/local/bin/npm" "install" "lodash"
27 error node v0.12.4
28 error npm  v2.10.1
29 error error:0906D06C:PEM routines:PEM_read_bio:no start line
30 error If you need help, you may report this error at:
30 error     <https://github.com/npm/npm/issues>
31 verbose exit [ 1, true ]

我一直在尋找解決問題的方法,嘗試了幾種解決方案,但沒有解決任何問題的方法。

有人可以幫我嗎?

非常感謝你

根據https://github.com/npm/npm/issues/8734 ,與NPN安裝相反,發生類似問題的原因與安裝軟件包有關。 我會在供應商(lodash)上記錄問題,以解決錯誤。

參考(npm / issues / 8734):

./bin/www  must exists and contains valid  index.js  file.
You can change folder value for  start  property.

I think it's not a NPM issue, please close this issue.
Go on StackOverflow or Google something like  express npm start node ./bin/www 

I hope I have helped you.

After install do  npm install -g npm@2.12.1 .

Check your version with  npm -v .

If the problem persist, your issue concern  express  or your package configuration not npm.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM