测试命令行工具,依照一些demo,但是完成后,执行却提示:no such file or directory,网上的一些例子都没有这样的提示
{
"name": "node-commander",
"version": "1.0.0",
"description": "",
"main": "index.js",
"bin": {
"hello": "hello.js"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
hello.js
#! /user/bin/env node
'use strict';
console.log('--- hello world ---');
执行 npm link,应该是没有成功,为什么了?
npm WARN node-commander@1.0.0 No description
npm WARN node-commander@1.0.0 No repository field.
/usr/local/bin/hello -> /usr/local/lib/node_modules/node-commander/hello.js
/usr/local/lib/node_modules/node-commander -> /Users/xuzhiqiang/Desktop/code/node-commander
执行:hello
zsh: /usr/local/bin/hello: bad interpreter: /user/bin/env: no such file or directory
请教大神们
并没有你写的
user
这个目录额