首页 > 解决方案 > zsh:权限被拒绝:在 npm 链接之后

问题描述

我正在尝试运行基本的 CLI 命令,但在npm link得到:

zsh: permission denied: testcom

文件myfile包含:

#!/usr/local/bin/ node


console.log('Hello!')

运行ls -alh

-rwxr-xr-x  1 markhorton  staff    46B  4 Dec 20:37 myfile

包.json

{
  "name": "katya",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "bin": {
    "testcom": "myfile"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}

但是,运行testcom表示权限被拒绝。

非常感谢任何帮助或建议。非常感谢,卡佳

标签: npmhyperlinkconsolecommand-line-interfacezsh

解决方案


推荐阅读