【发布时间】:2015-03-13 09:14:56
【问题描述】:
我创建了一个 package.json 并添加了所需的依赖项(grunt、bower、jasmine 等)
当我跑步时
npm install
它正确安装了所有的模块
$pwd/node_modules/*
但是当我尝试使用这些模块时:
bower init; grunt init
我明白了
sh.exe: (bower / grunt / w.e) Command not found
我可以通过使用来解决这个问题
npm install -g (package name)
但我的理解是“-g”使安装全局化? (对吗?)
我希望能够使用我在本地安装的软件包...这可能吗?
【问题讨论】:
-
很确定当您执行
-g时,该文件夹将添加到系统路径中的 npm 文件夹中。如果要从 node_modules 文件夹运行 bower/grunt,则需要指定该 bin 文件的实际路径:node_modules/bower/bin。或者类似的东西。
标签: javascript node.js npm