尝试在Raspberry Pi上安装npm错误

时间:2017-05-28 18:54:19

标签: node.js npm raspberry-pi electron

我正在开发一个带有javascript和电子的简单智能镜像项目。我能够在我的笔记本电脑上运行该软件,但是当我将它移动到树莓派时,我遇到了安装npm的问题。输入“npm install”后我得到了这个:

npm WARN package.json bcrypt-pbkdf@1.0.1 No repository field.
npm ERR! 404 Not Found
npm ERR! 404 
npm ERR! 404 'types/jquery' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'smart-mirror-server'
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Linux 4.9.24-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi/Desktop/smart-connected-mirror-master
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code E404
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/Desktop/smart-connected-mirror-master/npm-debug.log
npm ERR! not ok code 0

我试过了      sudo apt-get update 以及      sudo apt-get upgrade

任何想法该怎么办?谢谢!

编辑:

我将node.js更新为更新版本,现在安装时没有错误。但是,当我输入命令

 npm start

我明白了:

 sh: 1: electron: Permission denied

 npm ERR! Linux 4.9.24-v7+
 npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
 npm ERR! node v7.10.0
 npm ERR! npm  v4.2.0
 npm ERR! code ELIFECYCLE
 npm ERR! errno 126
 npm ERR! smart-mirror-server@1.0.0 start: `electron .`
 npm ERR! Exit status 126
 npm ERR! 
 npm ERR! Failed at the smart-mirror-server@1.0.0 start script 'electron      .'.
 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 smart-mirror-  server package,
 npm ERR! not with npm itself.
 npm ERR! Tell the author that this fails on your system:
 npm ERR!     electron .
 npm ERR! You can get information on how to open an issue for this project with:
 npm ERR!     npm bugs smart-mirror-server
 npm ERR! Or if that isn't available, you can get their info via:
 npm ERR!     npm owner ls smart-mirror-server 
 npm ERR! There is likely additional logging output above.

 npm ERR! Please include the following file with any support request:
 npm ERR!     /home/pi/.npm/_logs/2017-05-29T03_33_22_466Z-debug.log

1 个答案:

答案 0 :(得分:0)

你见过这个issue吗? Electron仅适用于RaspberryPi 2/3您使用的是什么版本?
在实际运行应用程序之前,您还运行npm install吗?有时将node_modules从操作系统复制到操作系统时,可执行权限会变得非常混乱 您可以尝试全新安装:rm -rf node_modules && npm install