简体   繁体   English

在克隆的vuejs项目上运行“ npm install”时出错

[英]Errors when running “npm install” on cloned vuejs project

Nodejs v4.2.6, Npm v3.5.2 Node.js v4.2.6,Npm v3.5.2

Recently did a system reset of windows 10 and then installed Ubuntu using dual boot. 最近对Windows 10进行了系统重置,然后使用双重引导安装了Ubuntu。 I'm relatively new to the Ubuntu operating system and only know enough Linux commands to get me around. 我是Ubuntu操作系统的新手,只知道足够的Linux命令可以帮助我。 When I run npm install in my VueJs project directory I get this: 当我在VueJs项目目录中运行npm install时,得到以下信息:

> grpc@1.9.0 install /home/george/code/bedal/portal.barcodexchange.com/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

/usr/bin/env: ‘node’: No such file or directory
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.1.3
npm ERR! Linux 4.10.0-28-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn

npm ERR! grpc@1.9.0 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the grpc@1.9.0 install script 'node-pre-gyp install --fallback-to-build --library=static_library'.
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 grpc package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs grpc
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls grpc
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/george/code/bedal/portal.barcodexchange.com/npm-debug.log

Despite the errors I tried running "npm run dev" in the same directory and this is what I get: 尽管有错误,我还是尝试在同一目录中运行“ npm run dev”,这是我得到的:

> barcode_portal@1.0.0 dev /home/george/code/bedal/portal.barcodexchange.com
> node build/dev-server.js

sh: 1: node: not found

npm ERR! Linux 4.10.0-28-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! barcode_portal@1.0.0 dev: `node build/dev-server.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the barcode_portal@1.0.0 dev script 'node build/dev-server.js'.
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 barcode_portal package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node build/dev-server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs barcode_portal
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls barcode_portal
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/george/code/bedal/portal.barcodexchange.com/npm-debug.log

This is what my file directory looks like in the VueJs project: 这是我的文件目录在VueJs项目中的样子:

.   
.babelrc  
config     
.editorconfig  
.eslintrc.js   
.firebaserc  
.gitignore  
node_modules   
package.json   
README.md  
.vscode
..  
build     
debug.log  
.eslintignore  
firebase.json  
.git         
index.html  
npm-debug.log  
.postcssrc.js  
src        
yarn.lock

Mind you the project worked fine on the Windows install but now I'm having trouble starting everything on Ubuntu. 请注意,该项目在Windows安装上运行良好,但是现在我在Ubuntu上启动所有程序时遇到了麻烦。 Help would be greatly appreciated, thank you for your time. 帮助将不胜感激,谢谢您的时间。

You need to install node.js on your system as Roland pointed out. 正如Roland指出的那样,您需要在系统上安装node.js。 Node has directions here . 节点在这里有指示。

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

Alternatively (and in my opinion, the best way) is to use NVM : 另外(我认为,最好的方法)是使用NVM

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash

Then 然后

nvm install node && nvm use node

This allows you to switch node versions quickly if need be. 这样,您可以根据需要快速切换节点版本。

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

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