简体   繁体   English

尝试使用npm安装软件包时出错

[英]Error while trying to install a package with npm

I need to install this package with. 我需要安装此软件包。 I'm in the node_modules folder and I do this: 我在node_modules文件夹中,我这样做:

URL: https://github.com/SparkPost/node-sparkpost


npm install sparkpost

and I obtain this error: 我得到这个错误:

npm ERR! Linux 3.19.0-47-generic
npm ERR! argv "node" "/usr/local/bin/npm" "install" "sparkpost"
npm ERR! node v0.10.25
npm ERR! npm  v3.9.2
npm ERR! path /home/francedema/Scrivania/Virtual Vagrant/Centos/nodebb/node_modules/bootstrap-colorpicker
npm ERR! code EISGIT

npm ERR! git /home/francedema/Scrivania/Virtual Vagrant/Centos/nodebb/node_modules/bootstrap-colorpicker: Appears to be a git repo or submodule.
npm ERR! git     /home/francedema/Scrivania/Virtual Vagrant/Centos/nodebb/node_modules/bootstrap-colorpicker
npm ERR! git Refusing to remove it. Update manually,
npm ERR! git or move it out of the way first.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/francedema/Scrivania/Virtual Vagrant/Centos/nodebb/npm-debug.log

Anyone can help me? 有人可以帮助我吗?

You should install NPM packages from the same directory as your package.json file. 您应该从与package.json文件相同的目录中安装NPM软件包。 Looking at your code, you will want to do something like this: 查看您的代码,您将需要执行以下操作:

cd "/home/francedema/Scrivania/Virtual Vagrant/Centos/nodebb"
npm install --save sparkpost

The --save option will add sparkpost to your package.json dependencies. --save选项会将sparkpost添加到您的package.json依赖项中。

It looks like you might also have some errors due to the bootstrap-colorpicker package. 似乎您也可能由于bootstrap-colorpicker软件包而出现一些错误。 I would try installing from the right directory first and see if that helps. 我会先尝试从正确的目录进行安装,看看是否有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM