简体   繁体   English

Node.js Express安装没有自述数据

[英]Node.js Express install No README data

I am totally brandnew to node.js and trying to install the express framework, not very sure why when i install Express by 我对node.js完全陌生,并尝试安装Express框架,但不太确定为什么我通过以下方式安装Express

$ npm express install --save

it gives me this package.json test@1.0.0 No README data then lots of ERR! 它给了我这个package.json test@1.0.0没有自述文件,然后有很多错误!

Thanks 谢谢

Debug log 调试日志

0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'install', 'express', '--save' ]
2 info using npm@2.7.4
3 info using node@v0.12.2
4 warn package.json test@1.0.0 No README data
5 silly cache add args [ 'express', null ]
6 verbose cache add spec express
7 silly cache add parsed spec { raw: 'express',
7 silly cache add   scope: null,
7 silly cache add   name: 'express',
7 silly cache add   rawSpec: '',
7 silly cache add   spec: '*',
7 silly cache add   type: 'range' }
8 verbose addNamed express@*
9 silly addNamed semver.valid null
10 silly addNamed semver.validRange *
11 silly addNameRange { name: 'express', range: '*', hasData: false }
12 silly mapToRegistry name express
13 silly mapToRegistry using default registry
14 silly mapToRegistry registry https://registry.npmjs.org/
15 silly mapToRegistry uri https://registry.npmjs.org/express
16 verbose addNameRange registry:https://registry.npmjs.org/express not in flight; fetching
17 verbose request uri https://registry.npmjs.org/express
18 verbose request no auth needed
19 info attempt registry request try #1 at 3:02:08 PM
20 verbose request id 42abc9c7545a84ee
21 verbose etag "5QPC4D9F40JTXPEZQJQJ5L09D"
22 http request GET https://registry.npmjs.org/express
23 http 304 https://registry.npmjs.org/express
24 silly get cb [ 304,
24 silly get   { date: 'Sat, 09 May 2015 07:02:18 GMT',
24 silly get     via: '1.1 varnish',
24 silly get     'cache-control': 'max-age=60',
24 silly get     etag: '"5QPC4D9F40JTXPEZQJQJ5L09D"',
24 silly get     age: '36',
24 silly get     connection: 'keep-alive',
24 silly get     'x-served-by': 'cache-hkg6823-HKG',
24 silly get     'x-cache': 'HIT',
24 silly get     'x-cache-hits': '1',
24 silly get     'x-timer': 'S1431154938.074288,VS0,VE2',
24 silly get     vary: 'Accept' } ]
25 verbose etag https://registry.npmjs.org/express from cache
26 verbose get saving express to /Users/clarkho/.npm/registry.npmjs.org/express/.cache.json

Log from Terminal 从终端登录

npm WARN package.json test@1.0.0 No README data
npm ERR! Darwin 12.5.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "express" "--save"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! path /Users/clarkho/.npm/debug/2.1.3
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, mkdir '/Users/clarkho/.npm/debug/2.1.3'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, mkdir '/Users/clarkho/.npm/debug/2.1.3']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/Users/clarkho/.npm/debug/2.1.3',
npm ERR!   parent: 'express' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

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

Log from terminal reports, that npm don't have rights for directory /Users/clarkho/.npm/debug/2.1.3 from currently user. 从终端报告中登录,表明npm没有当前用户对目录/Users/clarkho/.npm/debug/2.1.3的权限。 You can either change permission: 您可以更改权限:

sudo chown -R $(whoami) /Users/clarkho/.npm/debug/2.1.3

or run npm with sudo 或使用sudo运行npm

sudo npm install express --save

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM