node.js - 本地安装时的无关软件包

标签 node.js twitter-bootstrap npm

我试图安装 phantomjs 以便 进行测试 Twitter Bootstrap .在我在本地安装后,即 npm install phantomjs,它报告包是无关的。

├─┬ phantomjs@1.9.0-3 extraneous
│ ├── adm-zip@0.2.1
...
npm ERR! extraneous: phantomjs@1.9.0-3 /Users/admin/bootstrap/node_modules/phantomjs
npm ERR! not ok code 0

但是,当 phantomjs 全局安装时,即 npm install phantomjs -g,它运行良好,即没有报告无关错误。

问题:

  1. 是不是因为phantomjs not specified in the package.json file ?
  2. 一般问题:我们可以提供任何包裹吗? phantomjs 安装在全局和本地?

最佳答案

  1. 是的。 (使用 npm install 重新安装不会再次安装 phantom.js。)(顺便说一句:npm install xxx --save 会自动将 xxx 添加到 package.json)
  2. 是的。本地包版本优于全局包版本。 (尽管您需要对可执行文件进行一些路径处理。)

关于node.js - 本地安装时的无关软件包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16252750/

相关文章:

javascript - 将缓冲区转换为可读字符串javascript

node.js - 使用 Passport js 登录 google

css - 过滤器 : progid:DXImageTransform. Microsoft.gradient CSS 属性在 IE 中不起作用

node.js - 无法在 Raspbian-Raspberry Pi 3 上更新 nodejs 和 npm

javascript - 无法通过 gulp 实现 Bower 自动化

node.js - 在 ms-rest-azure 中,当我尝试获取身份验证 token 时,如何指定资源?

javascript - 你如何在 Gulp 任务中使用 browserify?

node.js - 尝试在 firestore 中保存时,参数返回未定义

html - 表格中的响应图像 (bootstrap 3)

javascript - twitter-bootstrap 按钮没有触发我的表单 .dialog()