试图在Raspberry Pi上安装npm错误
问题描述:
我正在使用JavaScript和电子进行一个简单的智能镜像项目。我能够在我的笔记本电脑上使用该软件,但是当我将它移动到覆盆子pi时,我遇到了安装npm的问题。进入“故宫安装”后,我得到这个:试图在Raspberry Pi上安装npm错误
npm WARN package.json [email protected] 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易于得到更新 以及 sudo易于得到升级
任何想法怎么办?谢谢!
编辑:
我更新了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! [email protected] start: `electron .`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the [email protected] 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
答
你见过这个issue?电子只适用于RaspberryPi 2/3你使用的是什么版本?
你还需要在运行应用程序之前运行npm install
?有时,从操作系统复制node_modules
到可执行权限会变得非常混乱。
您可以尝试全新安装:rm -rf node_modules && npm install
您使用的Node.js版本非常旧。尝试安装更新的版本(例如v6)。说明可以在这里找到:https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions – robertklep
可能重复的[为什么我只能安装NPM 3.5.2版本在Ubuntu 16.04?](https://stackoverflow.com/questions/44095985/why-can-i-only-install-version-3-5-2-of-npm-on-ubuntu-16-04) – Aurora0001
嗨@robertklep我更新了node.js,现在它已经正确安装。但是在输入npm start命令后,我得到一个新的错误。我编辑了原帖以显示此错误。我知道这些可能只是简单的问题,但我并不熟悉这一切。谢谢。 – Grumpy96