我首先在git clone
一个项目
准备初始化的时候,老是npm install
不了模块,
报错如下:
[root@VM_67_189_centos myblog]# ls
config logs models package.json README.md test
index.js middlewares node_modules public routes views
[root@VM_67_189_centos myblog]# ls node_modules
[root@VM_67_189_centos myblog]# npm install
npm WARN Invalid name: "lockeroots的手记"
npm WARN myblog No description
npm WARN myblog No repository field.
npm WARN myblog No README data
npm WARN myblog No license field.
这是我的package.json
文件
{
"name": "lockeroots的手记",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/lockeroots1126/blog-dev.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/lockeroots1126/blog-dev/issues"
},
"homepage": "https://github.com/lockeroots1126/blog-dev#readme",
"dependencies": {
"ace-builds": "^1.2.6",
"config-lite": "^1.5.0",
"connect-flash": "^0.1.1",
"connect-mongo": "^1.3.2",
"ejs": "^2.5.6",
"express": "^4.15.0",
"express-formidable": "^1.0.0",
"express-session": "^1.15.1",
"express-winston": "^2.3.0",
"jquery": "^3.1.1",
"marked": "^0.3.6",
"mocha": "^3.2.0",
"moment": "^2.17.1",
"mongolass": "^2.4.2",
"objectid-to-timestamp": "^1.3.0",
"prismjs": "^1.6.0",
"sha1": "^1.1.1",
"supertest": "^3.0.0",
"winston": "^2.3.1"
}
}
由于name会用在URL中,所有不接受非URL安全字符,故而不支持中文???
见:https://docs.npmjs.com/files/...