我在这里关注npm文档https://docs.npmjs.com/all以正确学习如何使用它,我设法下载correcly节点和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 ]
我一直在寻找解决问题,我尝试了几种解决方案,但没有解决问题。
有人可以帮我吗?
非常感谢
答案 0 :(得分:0)
根据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.