无法在nodejs -npm中安装snmpjs

时间:2017-01-05 10:44:42

标签: node.js ubuntu

我想在我的项目中使用snmpjs库,但我无法安装此软件包,我已经下载了最后一个npm,nodejs版本,但是当我尝试这个命令时:

npm install snmpjs

引发了这个错误:

snmpjs@0.1.8 install /home/user/Desktop/Project1/node_modules/snmpjs
jison -o lib/parser.js lib/snmp.jison

sh: 1: jison: Permission denied
/home/user/Desktop/Project1/
├── ejs@2.5.5 
├── express@4.14.0 
├── kafka-node@1.0.7 
├── net-snmp@1.1.19 
└── pg@6.1.2 

npm WARN enoent ENOENT: no such file or directory, open '/home/user/Desktop/Project1/package.json'
npm WARN Project1 No description
npm WARN Project1 No repository field.
npm WARN Project1 No README data
npm WARN Project1 No license field.
npm ERR! Linux 3.13.0-105-generic
npm ERR! argv "/home/user/.nvm/versions/node/v5.9.1/bin/node" "/home/user/.nvm/versions/node/v5.9.1/bin/npm" "install" "snmpjs"
npm ERR! node v5.9.1
npm ERR! npm  v3.7.3
npm ERR! code ELIFECYCLE

npm ERR! snmpjs@0.1.8 install: `jison -o lib/parser.js lib/snmp.jison`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the snmpjs@0.1.8 install script 'jison -o lib/parser.js lib/snmp.jison'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the snmpjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     jison -o lib/parser.js lib/snmp.jison
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs snmpjs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls snmpjs
npm ERR! There is likely additional logging output above.

我尝试过sudo,但我收到了这个错误:

sh: 1: jison: Permission denied
    npm ERR! weird error 126
    npm ERR! not ok code 0

1 个答案:

答案 0 :(得分:-1)

试试这个:

npm uninstall XXXX
npm cache clean
npm i -g npm 

我在debian clould系统上遇到问题。在更新节点和npm之后。