npm ERR! Linux 4.4.0-31-generic npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” "link" npm ERR! node v6.3.1 npm ERR! npm v3.10.3 npm ERR! path /usr/local/lib/node_modules/autogo/.bin/autogo.js npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/autogo/.bin/autogo.js’ npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/autogo/.bin/autogo.js’ npm ERR! enoent This is most likely not a problem with npm itself npm ERR! enoent and is related to npm not being able to find a file.
执行命令的目录下有bin目录和package.json文件 package.json文件内容是 { “name”: “autogo”, “version”: “1.0.0”, “description”: “”, “main”: “index.js”, “bin”: “.bin/autogo.js”, “scripts”: { “test”: “echo “Error: no test specified” && exit 1” }, “author”: “”, “license”: “ISC” } bin/autogo.js内容是 #!/usr/bin/env node console.log(“hello”); 当我执行npm link或者sudo npm link报错 是什么原因? 目的是做node命令行工具