我不确定这是否有目的,但在运行...时

npm install learnyounode -g

..command在终端中,该模块正在我的主目录中创建。当我尝试从运行npm install的目录中运行“learnyounode”命令时,出现消息“找不到命令”。我已经在usr目录中查找了,但该目录中不包含learningyounode目录。

完成所有安装后,我得到以下输出
/Users/username/npm/bin/learnyounode -> /Users/username/npm/lib/node_modules/learnyounode/learnyounode.js
[email protected] /Users/username/npm/lib/node_modules/learnyounode
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected],     [email protected], [email protected], [email protected], [email protected], [email protected])

ps。我在usr文件夹中重新安装了node。我更担心将来要通过NPM安装其他软件包时会发生此问题。

最佳答案

我安装时没有-g标志,并且已全局安装。

关于node.js - 尝试运行Nodeschool类(class)时找不到命令,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22026091/

10-09 22:14