λ npm link
npm WARN app@1.0.0 No repository field.
up to date in 0.724s
npm ERR! path C:\Users\Cooper\AppData\Roaming\npm\node_modules\app\app
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod 'C:\Users\Cooper\AppData\Roaming\npm\node_modules\app\app'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Cooper\AppData\Roaming\npm-cache\_logs\2018-04-06T17_15_16_211Z-debug.log
package.json文件如下:
{
"name": "app",
"version": "1.0.0",
"description": "玩转命令行开发",
"main": "index.js",
"bin": {
"app": "app"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "cooper",
"license": "ISC",
"devDependencies": {
"chalk": "^2.3.2",
"commander": "^2.15.1",
"inquirer": "^5.2.0"
}
}
楼主的实际代码应该是写在了app.js中,把package.json中bin里面的"app": "app"改成"app": "app.js"应该就可以了